From 7ad68aaed438ae5049fe019ab5049f621adbb370 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Tue, 6 Feb 2024 17:00:28 +0100 Subject: [PATCH] Fix `Menu` focus after closing --- src/components/Menu/Menu.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 7495d5d5..21a9f330 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -119,7 +119,17 @@ export const Menu: FC = ({ {trigger} - + { + // https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content => onCloseAutoFocus + // Prevent the default behavior of focusing the trigger when the menu closes + event.preventDefault(); + }} + > {children}