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.

If a `containerElements` element doesn't exist, focus-trap is confused

See original GitHub issue

If you set containerElements to [null], every tabbable node in the document is reachable. I believe this also happens when one of the container elements is no longer in the DOM.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
ziothcommented, Nov 29, 2020

Thanks!

1reaction
cgood92commented, Nov 17, 2020

Well, in this scenario, what would you expect to have happen?

Here is the line doing the logic affecting here: https://github.com/focus-trap/focus-trap/blob/master/index.js#L73.

I’m not sure what else you would expect here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New containerElements option doesn't lend itself to React #183
My scenario: I want to limit focus to the child of FocusTrap, and a set of CSS selectors. Here's what my code has...
Read more >
ERROR Error: You can't have a focus-trap without at least one ...
I got this error in my Angular code for opening a material design dialog(MDCDialog), but I have no clue at the first glance....
Read more >
accessibility | Read the Tea Leaves - Nolan Lawson
As it turns out, this works perfectly for tabbing through elements in the shadow DOM, just like <dialog> ! Unfortunately, it has exactly...
Read more >
Focus management with Vue refs - Learn web development
Vue components are written as a combination of JavaScript objects that manage the app's data and an HTML-based template syntax that maps to ......
Read more >
Focus trap in a dialog modal and after exiting, focus on the last ...
I have multiple modals with different id's. <div id="#Modal" tabindex="-1" class= active" style="left: Opx;" role="dialog" > <div ...
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