From c0f12c343e84c05474a356213ef1f67168ef1099 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Thu, 23 Nov 2023 14:00:49 +0100 Subject: [PATCH] Update submenu shift --- .../components/src/dropdown-menu-v2-ariakit/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/components/src/dropdown-menu-v2-ariakit/index.tsx b/packages/components/src/dropdown-menu-v2-ariakit/index.tsx index 7424b02b4b9f84..37d4a1f9cfcc5e 100644 --- a/packages/components/src/dropdown-menu-v2-ariakit/index.tsx +++ b/packages/components/src/dropdown-menu-v2-ariakit/index.tsx @@ -316,10 +316,12 @@ const UnconnectedDropdownMenu = ( { ...otherProps } modal={ modal } store={ dropdownMenuStore } - // Nested menus overlap by 8px + // Root menu has an 8px distance from its trigger, + // otherwise 0 (which causes the submenu to slightly overlap) gutter={ gutter ?? ( dropdownMenuStore.parent ? 0 : 8 ) } - // Nested menus have their items aligned horizontally - shift={ shift ?? ( dropdownMenuStore.parent ? -8 : 0 ) } + // Align nested menu by the same (but opposite) amount + // as the menu container's padding. + shift={ shift ?? ( dropdownMenuStore.parent ? -4 : 0 ) } hideOnHoverOutside={ false } data-side={ appliedPlacementSide } variant={ variant }