Skip to content

Conversation

@sai6855
Copy link
Contributor

@sai6855 sai6855 commented Nov 4, 2025

@mui-bot
Copy link

mui-bot commented Nov 4, 2025

Netlify deploy preview

https://deploy-preview-47178--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+119B(+0.02%) 🔺+36B(+0.02%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 🔺+151B(+1.19%) 🔺+52B(+1.04%)

Details of bundle changes

Generated by 🚫 dangerJS against 697a7b1


const list = tabListRef.current;
const currentFocus = ownerDocument(list).activeElement;
const currentFocus = getActiveElement(ownerDocument(list));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by adding a getActiveElement utility that recursively traverses shadow roots to find the actual focused
element. The issue was that document.activeElement returns the shadow host instead of the focused element inside
shadow DOM, causing keyboard navigation to fail the role="tab" check.

@sai6855 sai6855 requested a review from siriwatknp November 4, 2025 13:23
@sai6855 sai6855 changed the title [Tabs] Fix Arrow key navigation fails when component is rendered in shadow DOM [tabs] Fix Arrow key navigation fails when component is rendered in shadow DOM Nov 4, 2025
@sai6855 sai6855 added type: bug It doesn't behave as expected. package: material-ui Specific to Material UI. scope: tabs Changes related to the tabs. labels Nov 4, 2025
@sai6855 sai6855 changed the title [tabs] Fix Arrow key navigation fails when component is rendered in shadow DOM [tabs] Fix Arrow key navigation failing when component is rendered in shadow DOM Nov 5, 2025
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Nov 7, 2025

@sai6855 I would mark this as an "enhancement" instead of a "bug". What do you think? We don't claim to support all components inside Shadow DOM.

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

Labels

package: material-ui Specific to Material UI. scope: tabs Changes related to the tabs. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tabs] Arrow key navigation fails when component is rendered in shadow DOM

3 participants