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.

Issue on Chrome with tabindex="-1" container when there's a document selection

See original GitHub issue

Hi, I encounter a strange behavior on Chrome.

When I activate a focus trap on a radio group inside a container with tabindex="-1" I can no longer click radio labels to toggle radios, but only when I select some text before activating the focus trap 🤷‍♂️

Here is a gif of the issue : focus-trapissue

The code to reproduce : https://gist.github.com/romgere/daa6d4875ba613a4ed42f75d6bce73f6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
stefcameroncommented, Feb 20, 2021
0reactions
stefcameroncommented, Feb 22, 2021

Hi @stefcameron thx for the explaination & for you efforts to find a fix. On my side I’m able to remove the focusable div to restore the radio behavior. So don’t worry to much about this issues, at least before someone encounter same issue.

Thanks for the follow-up! I’m glad you got it working.

I’m going to close this issue. It can always be re-opened in the future if a lot of people start running into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tabindex - HTML: HyperText Markup Language | MDN
Click anywhere in this pane, then try tabbing through the elements. First in tab order: Tabbable due to tabindex. Not tabbable: no tabindex....
Read more >
pressKey('tab') sometimes works wrong with tabIndex=-1
There is a dialog popup and container with tabIndex=-1 in it. There are some inputs in the container. What is the Current behavior?...
Read more >
javascript - Why doesn't focus() select my container div?
When you set the tabindex=-1 for an element it allows it to get focus() through javascript. If instead you want it to get...
Read more >
Using tabindex - web.dev
Press Tab to Focus Me! tabindex="-1" : Removes an element from the natural tab order, but the element can still be focused by...
Read more >
HTML Roving tabindex Attribute Explained with Examples
You use the HTML tabindex attribute to set an element's tab position, and it usually indicates that an element can be tabbed with...
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