question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple modals and returnFocus

See original GitHub issue

Focus is not returned with multiple <FocusLock>s.

Sample CRA project: https://github.com/andraaspar/react-focus-lock-stack-missing

To reproduce:

  1. Click ‘Open modal 1’
  2. On the modal, click ‘Open modal 2’
  3. On the 2nd modal, click ‘X2’ → Focus is set to ‘Open modal 2’ instead of ‘X1’
  4. On the modal, click ‘X1’ → Focus is not returned to ‘Open modal 1’

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
theKasheycommented, Mar 17, 2020

Sure. This might also resolve another issue with a too-fast move focus inside - https://github.com/theKashey/react-focus-on/issues/36

0reactions
Haraldsoncommented, Mar 16, 2020

It’s not super easy to solve it with the current tools provided with focus-lock, so maybe it would be a good idea to somehow have it trigger on an event, or after a timeout as you suggest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple modals | Yale Grammatical Diversity Project
Multiple modals are instances of more than one modal occurring in a single sentence. (Modals are words like can, might, and should that...
Read more >
Creating An Accessible Modal Dialog - bitsofcode
Modal Dialogs are a tricky thing to make accessible. ... Set Focus; On Dialog Close, Return Focus to the Last Focused Element; While...
Read more >
Modal | Components - BootstrapVue
<b-modal> provides several accessibility features, including auto focus, return focus, keyboard (tab) focus containment, and automated aria-* attributes. Note: ...
Read more >
Modal | Components | BootstrapVue
Accessibility. <b-modal> provides several accessibility features, including auto focus, return focus, and keyboard (tab) focus containment.
Read more >
T87714 Return focus to the last location when a modal dialog is ...
Return focus to the last location when a modal dialog is dismissed. Closed, ResolvedPublic. Actions · Description · Details · Related Objects. Search......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found