Skip to content

fix: retain tab focus across fragment-wrapped selection changes - #633

Open
feritcemkahraman wants to merge 1 commit into
reactjs:mainfrom
feritcemkahraman:fix/fragment-tab-focus
Open

feritcemkahraman wants to merge 1 commit into
reactjs:mainfrom
feritcemkahraman:fix/fragment-tab-focus

Conversation

@feritcemkahraman

Copy link
Copy Markdown

When controlled tabs are wrapped in a fragment, changing selectedIndex leaves keyboard focus on the old, now unselected tab.

Check the registered tab elements for focus instead of checking only direct React children. This preserves focus across selection changes while leaving focus outside the tabs alone.

Validation: the focus regression failed before the fix; all 81 tests, full ESLint, and the CommonJS/ESM builds pass. Windows checkout line endings were normalized locally for lint. The real-browser matrix and documentation build were not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant