We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbfb237 commit eb0a586Copy full SHA for eb0a586
client/components/Menubar/Menubar.jsx
@@ -150,7 +150,7 @@ function Menubar({ children, className }) {
150
151
const handleBlur = useCallback(
152
(e) => {
153
- const isInMenu = nodeRef.current?.contains(e.relatedTarget);
+ const isInMenu = nodeRef.current?.contains(document.activeElement);
154
155
if (!isInMenu) {
156
timerRef.current = setTimeout(() => {
@@ -206,7 +206,10 @@ function Menubar({ children, className }) {
206
// roving tabindex
207
prevNode?.setAttribute('tabindex', '-1');
208
activeNode?.setAttribute('tabindex', '0');
209
- activeNode?.focus();
+
210
+ if (hasFocus) {
211
+ activeNode?.focus();
212
+ }
213
}
214
}, [activeIndex, prevIndex, menuItems]);
215
0 commit comments