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

Commit 7c226b9

Browse files
committed
Fix roving tab index focus tracking on interactive element like context menu trigger
1 parent 08b1fdb commit 7c226b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/views/messages/MessageActionBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ const OptionsButton: React.FC<IOptionsButtonProps> = ({
6767
const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu();
6868
const [onFocus, isActive, ref] = useRovingTabIndex(button);
6969
useEffect(() => {
70+
onFocus();
7071
onFocusChange(menuDisplayed);
71-
}, [onFocusChange, menuDisplayed]);
72+
}, [onFocus, onFocusChange, menuDisplayed]);
7273

7374
let contextMenu: ReactElement | null;
7475
if (menuDisplayed) {

0 commit comments

Comments
 (0)