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
parent
942fabc5a8
commit
8bd74f517c
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue