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.

[Combobox] Tab sequence gets stuck in popover interactive elements

See original GitHub issue

🐛 Bug report

Current Behavior

When tabbing to interactive elements in the popover, the tab sequence gets stuck in the popover

combobox-no-tab-escape-from-popover

Compare this to the popover itself, which does not track the tab sequence.

popover-tab-behavior

Interestingly, the tab sequence issue is not reproducible on the website examples, despite creating a clean slate with cd website/ && rm -rf node_modules && yarn && yarn dev.

combobox-website

Expected behavior

There is nothing mentioned on WAI ARIA about trapping focus in the listbox popover, so I would expect the tab sequence to predictably follow the browser default sequence, i.e. how the current Reach UI popover component behaves (as shown above).

Reproducible example

CodeSandbox Template

Running the Storybook examples locally will also reproduce this issue

Suggested solution(s)

Even after tinkering locally, its not clear to me why the tab sequence is trapped in the combobox popover (and also why it isn’t on the website examples).

Additional context

Your environment

Software Name(s) Version
Reach Package combobox 0.10.0
React - 16.13.0
Browser Chrome 80.0.3987.163
Assistive tech - -
Node - v13.12.0
npm/yarn yarn 1.22.4
Operating System macOS 10.15.4

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
michaeldfoleycommented, Jun 6, 2020

I too believe that the issue relates to Popover, specifically cases where the targetRef is the last tabbable element outside the popover. When this is the case, getElementAfterTrigger returns the first tabbable element inside the portal causing the focus to stay trapped inside the popover. What we want is for getElementAfterTrigger to return an element only if it is not inside the popover.

I submitted a PR (#609) that should address the issue. I recreated the original example referenced in this issue and the focus now moves outside the popover as expected.

0reactions
chaancecommented, Jun 15, 2020

Should be fixed in 0.10.4. Please let me know if you continue to have issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Freeze screen in chrome debugger / DevTools panel for ...
Go to the Elements tab in inspector. Find your popover (it will be nested in the trigger element's HTML)
Read more >
ARIA: tab role - Accessibility - MDN Web Docs - Mozilla
The ARIA tab role indicates an interactive element inside a tablist that, when activated, displays its associated tabpanel.
Read more >
JavaScript · Bootstrap
If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel="popover"]').data('popover') .
Read more >
Building Accessible Menu Systems - Smashing Magazine
There are lots of different types of menu on the web. Creating inclusive experiences is a question of using the right menu patterns...
Read more >
Resolved Issues | Pega Community
When using Google Chrome, validation of records was getting stuck in the ... directly in a new tab populated the dropdown values as...
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