Skip to content

Commit

Permalink
Handle standalone items use-case
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Sep 23, 2024
1 parent 15fb8dd commit 9607ba8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/components/src/dropdown-menu/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export const WithChildren: StoryObj< typeof DropdownMenu > = {
icon: more,
children: ( { onClose } ) => (
<>
<MenuItem icon={ arrowUp } onClick={ onClose }>
Standalone Item
</MenuItem>
<MenuGroup>
<MenuItem icon={ arrowUp } onClick={ onClose }>
Move Up
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/dropdown/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const WithMenuItems: StoryObj< typeof Dropdown > = {
...Default.args,
renderContent: () => (
<>
<MenuItem>Standalone Item</MenuItem>
<MenuGroup label="Group 1">
<MenuItem>Item 1</MenuItem>
<MenuItem>Item 2</MenuItem>
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/dropdown/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

&:has(.components-menu-group) {
padding: 0;

.components-dropdown-menu__menu > .components-menu-item__button,
> .components-menu-item__button {
margin: $grid-unit-10;
width: auto;
}
}
}

Expand Down

0 comments on commit 9607ba8

Please sign in to comment.