Handle up/down as well as left/right for horizontal toolbars for improved a11y (#12305)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
942fabc5a8
commit
8bd74f517c
1 changed files with 2 additions and 1 deletions
|
@ -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 (
|
return (
|
||||||
<RovingTabIndexProvider handleHomeEnd handleLeftRight onKeyDown={onKeyDown}>
|
<RovingTabIndexProvider handleHomeEnd handleLeftRight handleUpDown onKeyDown={onKeyDown}>
|
||||||
{({ onKeyDownHandler }) => (
|
{({ onKeyDownHandler }) => (
|
||||||
<div {...props} onKeyDown={onKeyDownHandler} role="toolbar" ref={ref}>
|
<div {...props} onKeyDown={onKeyDownHandler} role="toolbar" ref={ref}>
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Reference in a new issue