Handle up/down as well as left/right for horizontal toolbars for improved a11y (#12305)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/28217/head
Michael Telatynski 2024-03-06 14:41:14 +00:00 committed by GitHub
parent 942fabc5a8
commit 8bd74f517c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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}