Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Handle up/down arrow keys as well as left/right for horizontal toolbars for improved a11y #12305

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/accessibility/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ const Toolbar = forwardRef<HTMLDivElement, IProps>(({ children, ...props }, ref)
}
};

// We handle both up/down and left/right as is allowed in the above WAI ARIA best practices
return (
<RovingTabIndexProvider handleHomeEnd handleLeftRight onKeyDown={onKeyDown}>
<RovingTabIndexProvider handleHomeEnd handleLeftRight handleUpDown onKeyDown={onKeyDown}>
{({ onKeyDownHandler }) => (
<div {...props} onKeyDown={onKeyDownHandler} role="toolbar" ref={ref}>
{children}
Expand Down
Loading