Browse Source

ref(dropdownMenu): Forward size prop to submenu (#37574)

Vu Luong 2 years ago
parent
commit
b9ff36fab1

+ 1 - 0
static/app/components/dropdownMenuControl.tsx

@@ -197,6 +197,7 @@ function MenuControl({
         {...menuProps}
         triggerRef={ref}
         triggerWidth={triggerWidth}
+        size={size}
         isSubmenu={isSubmenu}
         isDismissable={!isSubmenu && props.isDismissable}
         shouldCloseOnBlur={!isSubmenu && props.shouldCloseOnBlur}

+ 3 - 0
static/app/components/dropdownMenuV2.tsx

@@ -48,6 +48,7 @@ type Props = {
    */
   menuTitle?: string;
   onClose?: () => void;
+  size?: MenuItemProps['size'];
   /**
    * Current width of the trigger element. This is used as the menu's minimum
    * width.
@@ -65,6 +66,7 @@ function Menu({
   closeOnSelect = true,
   triggerRef,
   triggerWidth,
+  size,
   isSubmenu,
   menuTitle,
   closeRootMenu,
@@ -191,6 +193,7 @@ function Menu({
         crossOffset={-8}
         closeOnSelect={closeOnSelect}
         isOpen={state.selectionManager.isSelected(node.key)}
+        size={size}
         isSubmenu
         closeRootMenu={closeRootMenu}
         closeCurrentSubmenu={() => state.selectionManager.clearSelection()}