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

fix(react-tabs): focus selected tab by default #33236

Conversation

dmytrokirpa
Copy link
Contributor

@dmytrokirpa dmytrokirpa commented Nov 8, 2024

Previous Behavior

When the focus shifts to the tab list, it either moves to the last tab that was focused on or defaults to the first tab.

And according to the https://www.w3.org/WAI/ARIA/apg/patterns/tabs/#keyboard_interaction this is not the expected behavior.

Screenshot 2024-11-08 at 15 11 31

New Behavior

When the focus shifts to the tab list, it automatically moves to the currently selected tab, or if none is selected, it defaults to the first tab.

Related Issue(s)

Copy link

github-actions bot commented Nov 8, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.162 MB
291.009 kB
1.162 MB
291.037 kB
60 B
28 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.21 kB
20.174 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
220.616 kB
63.902 kB
react-components
react-components: FluentProvider & webLightTheme
44.447 kB
14.59 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-timepicker-compat
TimePicker
107.372 kB
35.755 kB
🤖 This report was generated against addcaf6e6ac5dcfbddd68a52ffdf5a399ed7be5b

Copy link

github-actions bot commented Nov 8, 2024

Pull request demo site: URL

@dmytrokirpa dmytrokirpa merged commit 4046b33 into microsoft:master Nov 13, 2024
16 checks passed
@dmytrokirpa dmytrokirpa deleted the fix/tabs-focus-selected-tab-by-default branch November 13, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Tablist focus on first tab instead of selected tab
3 participants