Skip to content

Commit

Permalink
[RovingFocusGroup] Move only with single arrow keys (radix-ui#2739)
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitgrelard authored Feb 28, 2024
1 parent f243570 commit 1fbb93c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .yarn/versions/f4333956.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
releases:
"@radix-ui/react-context-menu": patch
"@radix-ui/react-dropdown-menu": patch
"@radix-ui/react-menu": patch
"@radix-ui/react-menubar": patch
"@radix-ui/react-radio-group": patch
"@radix-ui/react-roving-focus": patch
"@radix-ui/react-tabs": patch
"@radix-ui/react-toggle-group": patch
"@radix-ui/react-toolbar": patch

declined:
- primitives
1 change: 1 addition & 0 deletions packages/react/roving-focus/src/RovingFocusGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ const RovingFocusGroupItem = React.forwardRef<RovingFocusItemElement, RovingFocu
const focusIntent = getFocusIntent(event, context.orientation, context.dir);

if (focusIntent !== undefined) {
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
event.preventDefault();
const items = getItems().filter((item) => item.focusable);
let candidateNodes = items.map((item) => item.ref.current!);
Expand Down

0 comments on commit 1fbb93c

Please sign in to comment.