Skip to content

[Tabs] Fix modifier keys + Left/Right Arrow key from being consumed by tab navigation #45345

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

Merged
merged 10 commits into from
Mar 19, 2025

Conversation

mushfiqbh
Copy link
Contributor

@mushfiqbh mushfiqbh commented Feb 18, 2025

@zannager zannager added the component: tabs This is the name of the generic UI component, not the React module! label Feb 18, 2025
@zannager zannager requested a review from DiegoAndai February 18, 2025 13:27
@mui-bot
Copy link

mui-bot commented Feb 18, 2025

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 8e9b2b0

@mushfiqbh mushfiqbh changed the title [material-ui][Tabs] Fix Alt+Arrow from being consumed by tab navigation [Tabs] Fix Alt+Arrow from being consumed by tab navigation Feb 18, 2025
@mushfiqbh mushfiqbh changed the title [Tabs] Fix Alt+Arrow from being consumed by tab navigation [Tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation Feb 18, 2025
Dazbii

This comment was marked as resolved.

Copy link
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.

I've tested this and it works: https://codesandbox.io/p/sandbox/material-tabs-bug-forked-4mh6ml

Probably the same logic should be applied to all modifier keys like Shift/Ctrl as well, what do you think @aarongarciah @DiegoAndai

@mushfiqbh Also would you mind adding some tests around this? I would suggest a new describe('modifier keys', () => {…}) block nested directly under this one: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.test.js#L928

@mj12albert mj12albert added the package: material-ui Specific to @mui/material label Feb 19, 2025
@DiegoAndai
Copy link
Member

Probably the same logic should be applied to all modifier keys like Shift/Ctrl as well, what do you think @aarongarciah @DiegoAndai

Agreed

@oliviertassinari oliviertassinari changed the title [Tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation [tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation Mar 1, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation [Tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation Mar 19, 2025
@ZeeshanTamboli ZeeshanTamboli added the bug 🐛 Something doesn't work label Mar 19, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [Tabs] Fix Alt+Left/Right Arrow shortcut from being consumed by tab navigation [Tabs] Fix modifier keys + Left/Right Arrow key from being consumed by tab navigation Mar 19, 2025
@ZeeshanTamboli ZeeshanTamboli added v6.x needs cherry-pick The PR should be cherry-picked to master after merge labels Mar 19, 2025
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

I made the expected changes. @mushfiqbh Thanks for the PR.

@ZeeshanTamboli ZeeshanTamboli enabled auto-merge (squash) March 19, 2025 11:43
@ZeeshanTamboli ZeeshanTamboli merged commit 85086c9 into mui:master Mar 19, 2025
19 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v6.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tabs This is the name of the generic UI component, not the React module! needs cherry-pick The PR should be cherry-picked to master after merge package: material-ui Specific to @mui/material v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tabs] Left/Right Arrow keyboard shortcuts consume Alt+Left/Right Arrow browser shortcuts for Back/Forward
7 participants