You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a modal, and the first element is a link (<a>), then focus can escape if you are using Safari and you either (a) did not enable the setting "Press Tab to highlight each item on a webpage" or (b) are not using Option+Tab to navigate. It looks like since the browser skips focus on that link that the focus trap listeners don't ever get a chance to fire.
Steps to reproduce:
Create a simple ReactModal with a link and a button:
In Safari's Settings / Advanced, uncheck "Press Tab to highlight each item on a webpage".
Open the modal, the link is focused.
Hit Tab, the Inner Button is focused.
Hit Shift+Tab, the Outer Button is focused.
Expected behavior:
Focus should be trapped in modals on Safari no matter whether you are using Tab or Option Tab, despite your setting for "Press Tab to highlight each item on a webpage".
Summary:
Focus Trap not working in Safari with Link
If you create a modal, and the first element is a link (
<a>
), then focus can escape if you are using Safari and you either (a) did not enable the setting "Press Tab to highlight each item on a webpage" or (b) are not using Option+Tab to navigate. It looks like since the browser skips focus on that link that the focus trap listeners don't ever get a chance to fire.Steps to reproduce:
Expected behavior:
Focus should be trapped in modals on Safari no matter whether you are using Tab or Option Tab, despite your setting for "Press Tab to highlight each item on a webpage".
Link to example of issue:
https://codesandbox.io/s/react-modal-issue-template-forked-5kvtgx
Additional notes:
The text was updated successfully, but these errors were encountered: