Skip to content

Commit 74a67be

Browse files
im-adithyaggazzo
andauthored
fix(fuselage): Menu toggle (#389)
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
1 parent 904386f commit 74a67be

File tree

1 file changed

+7
-2
lines changed
  • packages/fuselage/src/components/Menu

1 file changed

+7
-2
lines changed

packages/fuselage/src/components/Menu/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ export const Menu = ({
3030

3131
const ref = useRef();
3232
const onClick = useCallback(() => {
33-
ref.current.focus() & show();
34-
ref.current.classList.add('focus-visible');
33+
if (ref.current.classList.contains('focus-visible')) {
34+
ref.current.classList.remove('focus-visible');
35+
hide();
36+
} else {
37+
ref.current.focus() & show();
38+
ref.current.classList.add('focus-visible');
39+
}
3540
}, [show]);
3641

3742
const handleSelection = useCallback(

0 commit comments

Comments
 (0)