fix: CMD + arrows should not navigate RAC Tabs as it's a browser shortcut#9650
fix: CMD + arrows should not navigate RAC Tabs as it's a browser shortcut#9650Zdog1206 wants to merge 8 commits intoadobe:mainfrom
Conversation
Fix issue adobe#9648 such that pressing CMD + left/right arrow actually triggers the browser's forward and back actions instead of moving between the tabs on the screen.
Another user requested the code be written slightly differently to avoid issues in other parts of the program.
| } | ||
| }; | ||
|
|
||
| if (manager.selectionMode === 'single' && (e.metaKey || e.altKey)) { |
There was a problem hiding this comment.
This is close, but it's going to affect too many things. I think it should be restricted to Left/Right arrows OR handling should be moved to the Tab's keyboard delegate.
Otherwise it may interfere with some of our selectionMode+selectionBehaviour https://react-aria.adobe.com/ListBox#selection
It looks like Up/Down + meta scrolls the entire page or moves the text cursor to the start or end of an input. I think in Tabs it shouldn't do anything. Much like the Toolbar in this github comment box.
|
Note to team: Don't love how hard this is to figure out, possibly we could do something like this https://github.com/adobe/react-spectrum/compare/keyboard-shortcut-handler?expand=1 |
# Conflicts: # packages/react-aria/src/selection/useSelectableCollection.ts
|
Thanks again for the PR and getting this started. Given the complexity pointed out in this PR and some other goals we have for event leaking, I'm going to close this PR and pursue something more along the lines of the diff I linked in this comment #9650 (comment) and libraries like https://github.com/jamiebuilds/tinykeys |
Closes <#9648>
📝 Test Instructions: