[tree view] Cursor navigation interferes with browser shortcut keys #14296
Labels
bug 🐛
Something doesn't work
component: tree view
TreeView, TreeItem. This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
Steps to reproduce
Link to live example: https://mui.com/x/react-tree-view/simple-tree-view/items/#basics
Steps:
Current behavior
The tree view responds to the Left and Right arrow keys to go higher or lower in the tree view, which is useful, but it also intercepts the arrow keys even if Command is pressed, so it interferes with browser history.
Expected behavior
The tree view responds only to plain left/right arrow key presses (no Command-), or the tree view at least doesn't intercept Command-Left and Command-Right.
Context
I noticed that the tree view doesn't respond to the Alt key, so the Alt-Left and Alt-Right browser shortcuts work on Windows, but it allows the Command key (KeyboardEvent.metaKey) for Mac.
https://github.com/mui/mui-x/blob/v7.13.0/packages/x-tree-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.ts#L95
Your environment
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: