Back/forward keyboard shortcuts (e.g. CMD + left arrow) triggering tab switching rather than page navigation - bug or intentional? #9628
-
|
To recreate: focus a tab, and hit CMD + left/right arrow. This switches tabs rather than trigger browser back/foward. I checked the WCAG pattern and didn't see anything about what the behaviour for this should be - just that arrow keys should trigger tab switching without mentioning CMD or other meta keys. I'm happy to create an issue for this if it is indeed a bug, but wanted to check to see if it's intentional behaviour beforehand. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Thanks for reporting, that seems undesirable. Most likely we're handling the arrow keys and not checking the modifier keys. We probably need to early return and continue propagation of the keyboard event here: In an probably need a check for if selectionMode is single and meta key
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the reply! Had a hunch it was something like that. Would you like me to create an issue for it? |
Beta Was this translation helpful? Give feedback.
Thanks for reporting, that seems undesirable. Most likely we're handling the arrow keys and not checking the modifier keys.
We probably need to early return and continue propagation of the keyboard event here:
react-spectrum/packages/@react-aria/selection/src/useSelectableCollection.ts
Line 128 in 0efd2d4
In an probably need a check for
if selectionMode is single and meta key