Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support automatic activation of tabs #1411

Open
dgreene1 opened this issue May 16, 2022 · 1 comment
Open

Support automatic activation of tabs #1411

dgreene1 opened this issue May 16, 2022 · 1 comment
Milestone

Comments

@dgreene1
Copy link

Is your feature request related to a problem? Please describe.

When using a keyboard to navigate tabs, the new tab does not become active until you press enter or space.

W3 says:

It is recommended that tabs activate automatically when they receive focus as long as their associated tab panels are displayed without noticeable latency. This typically requires tab panel content to be preloaded. Otherwise, automatic activation slows focus movement, which significantly hampers users' ability to navigate efficiently across the tab list. For additional guidance, see § 6.4 Deciding When to Make Selection Automatically Follow Focus.

(link)

Describe the solution you'd like A clear and concise description of what you
want to happen.

A new property would be added to TabProps called activationMode that would be of type "automatic" | "manual". This property would be optional and would default to "manual" since that is the current behavior.

When activationMode: "automatic", if you pressed the right arrow key on the keyboard to cycle through the tabs, the tab panel that is associated with that tab would be shown.

We can consider linking this feature to the persistent flag since the W3 quote above shows that you shouldn't use automatic activation unless the component has been pre-rendered.

Describe alternatives you've considered

I haven't considered any other options.

Additional context
none

@mlaursen
Copy link
Owner

I believe this feature has been implemented but on the Tabs component instead of the Tab itself by enabling the automatic prop. The Configurable Tabs Demo can be used to preview that functionality and with the persistent flag as well. Maybe it would be better for me to simplify the example and showcase the selection mode as a separate demo.

That being said, I like the activationMode: "manual" | "automatic" naming more than automatic: boolean, so I'll probably rename that prop in the future.

@mlaursen mlaursen added this to the v6.0.0 milestone Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants