Skip to content

[MUI] [Button,List,ToggleButton] Integrate useRovingTabIndex for Button, ButtonGroup, List, ListItemButton, ToggleButton, and ToggleButtonGroup #48321

Open
mustafajw07 wants to merge 4 commits intomui:masterfrom
mustafajw07:feature/48306-Integrate-useRovingTabIndex
Open

[MUI] [Button,List,ToggleButton] Integrate useRovingTabIndex for Button, ButtonGroup, List, ListItemButton, ToggleButton, and ToggleButtonGroup #48321
mustafajw07 wants to merge 4 commits intomui:masterfrom
mustafajw07:feature/48306-Integrate-useRovingTabIndex

Conversation

@mustafajw07
Copy link
Copy Markdown

@mustafajw07 mustafajw07 commented Apr 17, 2026

…oved keyboard navigation in Button, ButtonGroup, List, ListItemButton, ToggleButton, and ToggleButtonGroup components
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard bot commented Apr 17, 2026

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+476B(+0.09%) 🔺+183B(+0.12%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Deploy preview

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


Check out the code infra dashboard for more information about this PR.

Copy link
Copy Markdown
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

  1. It would better if this PR was scoped to one component first
  2. The new behavior must be opt-in somehow, it would be better to discuss how to do this in the issue first

…ngTabIndex integration for simplified component structure
@mustafajw07
Copy link
Copy Markdown
Author

  1. It would better if this PR was scoped to one component first
  2. The new behavior must be opt-in somehow, it would be better to discuss how to do this in the issue first

I have updated the pr to include only List component first

@@ -5,6 +5,7 @@ import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a huge breaking change for this to unconditionally become a roving focus parent

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You're absolutely right — this is a breaking change that shouldn't be unconditional.

how about this approach:

Add an optional prop: disableRovingTabIndex (or enableRovingTabIndex={false} by default)
Default to disabled (backward compatible)
Users explicitly opt-in when they want roving behavior

Comment thread packages/mui-material/src/List/List.js Outdated
Comment on lines 91 to 92
{...rovingContainerProps}
{...other}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

roving focus event handlers can be easily overwritten by accident silently

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

should i Extracting event handlers separately and create wrapper functions that call both roving handlers and user callbacks?

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.

2 participants