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.

[Tabs] When a Tab is disabled, keyboard traversal is stuck

See original GitHub issue

Normally keyboard users will tab into a Tabs group, then use either Left/Right (if horizontal tab) or Up/Down (vertical) to traverse the Tabs and according to WAI aria practices, the Tabs should wrap around (last <-> first tabs); this works great right now unless a Tab is disabled, in which case it will break the traversal instead of skip the disabled Tab.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

If a Tab is in disabled state, then it acts like a hard stop in the traversal order.

Expected Behavior 🤔

Match the behavior to the way MenuItems with disabled items are traversed and just skip the disabled Tab.

Maybe you could do something in Tabs.js, handleKeyDown, around here:

case previousItemKey:
        newFocusTarget = target.previousElementSibling || tabListRef.current.lastChild;

look for disabled state

Steps to Reproduce 🕹

https://codesandbox.io/s/basictabs-material-demo-forked-sh1rd?file=/demo.js Hope I forked and saved this correctly. it’s the basic Tab example with a button for convenient focus. Tab 2 is disabled; you can tab into the Tabs group and then you can see how the arrow traversal hits a wall when it encounters disabled Tab 2.

Steps:

  1. Take a look at the codesandbox link
  2. If I messed that up, then just take the simple tab demo (first one) and add a disabled on any one of the Tab components

Context 🔦

a11y compliance

Your Environment 🌎

this happens on the demo code.

`npx @material-ui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Apr 28, 2021

@anish-khanna I believe the two linked logic handle the case. It would be great.

1reaction
anish-khannacommented, Apr 28, 2021

I’m new but if nobody else is taking a crack it this issue, I can try and get it resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tab key stuck? - Microsoft Community
This thread is locked. ... Scroll down and click Keyboard > Run Troubleshooter 2. Unplug keyboard and mouse then perform a power cycle...
Read more >
Windows apps acting like tab key is stuck, but it's not?
1) Try to disable Sticky Keys (look up on the internet how to do this), and see if that works. · 2) If...
Read more >
"Tab moves focus" disabled, but tab still moves focus ... - GitHub
Synopsis: Regardless of "Tab moves focus" being enabled or disabled, tab never inserts tab-or-space characters and instead always "moves focus".
Read more >
Using Keyboard-only Navigation, for Web Accessibility
Navigating through a website with a keyboard uses the TAB key to move forward and the SHIFT+TAB combination to move backwards. These keys...
Read more >
[Fix] 'Tab Key not Working' on Windows - YouTube
Read More: https://appuals.com/how-to-fix- tab -key-not-working-on-windows/
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