The focus event is not fired in Firefox with Shift+Tab?

160 Views Asked by At

See full code and play with it here: https://plnkr.co/edit/qJ7eiJewb0hmj8wF?open=lib%2Fscript.js&preview

Pseudo code:

<div parent focusable>
    <iframe>
        #document
        <input textbox>
    </iframe>
</div>

Click to focus to the textbox, then Shift+Tab

  • In Chrome: the focus is moved directly from the textbox to the parent
  • In Firefox: the focus is moved from the textbox to the iframe, you will have to Shift+Tab a second time to move the focus to the parent

Question: How to replicate the same behavior Shift+Tab of Chrome in Firefox?

I can replicate the behaviour of Tab of Chrome in Firefox but I'm unable to replicate the behaviour of Shift+Tab because no focus event is fired when the focus moved to the iframe (in case of Shift+Tab).

Note: Paypal solved this problem in their payment forms:

https://codepen.io/braintree/pen/ZWPpPG

but I'm unable to find out where did they do the magic

0

There are 0 best solutions below