Add arrow key controls to emoji and reaction pickers (#10637)
* Add arrow key controls to emoji and reaction pickers * Iterate types * Switch to using aria-activedescendant * Add tests * Fix tests * Iterate * Update test * Tweak header keyboard navigation behaviour * Also handle scrolling on left/right arrow keys * Iterate
This commit is contained in:
parent
0d9fa0515d
commit
2da52372d4
15 changed files with 277 additions and 74 deletions
|
@ -36,17 +36,14 @@ export function EmojiButton({ addEmoji, menuPosition, className }: IEmojiButtonP
|
|||
let contextMenu: React.ReactElement | null = null;
|
||||
if (menuDisplayed && button.current) {
|
||||
const position = menuPosition ?? aboveLeftOf(button.current.getBoundingClientRect());
|
||||
const onFinished = (): void => {
|
||||
closeMenu();
|
||||
overflowMenuCloser?.();
|
||||
};
|
||||
|
||||
contextMenu = (
|
||||
<ContextMenu
|
||||
{...position}
|
||||
onFinished={() => {
|
||||
closeMenu();
|
||||
overflowMenuCloser?.();
|
||||
}}
|
||||
managed={false}
|
||||
>
|
||||
<EmojiPicker onChoose={addEmoji} />
|
||||
<ContextMenu {...position} onFinished={onFinished} managed={false}>
|
||||
<EmojiPicker onChoose={addEmoji} onFinished={onFinished} />
|
||||
</ContextMenu>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue