Skip to content

Commit

Permalink
fix: add pressed state on MenuButton (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Jun 28, 2023
1 parent a0e4bb9 commit a608c8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/fuselage/src/components/Menu/V2/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,15 @@ export const AsSidebarTopbarActions = () => (
</Menu>
</Sidebar.TopBar.Actions>
);

export const ControlledOpenState = () => {
const [isOpen, setIsOpen] = useState(false);

return (
<Menu isOpen={isOpen} onOpenChange={setIsOpen}>
<MenuItem key='1'>Profile</MenuItem>
<MenuItem key='2'>Chats</MenuItem>
<MenuItem key='3'>Settings</MenuItem>
</Menu>
);
};
1 change: 1 addition & 0 deletions packages/fuselage/src/components/Menu/V2/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const Menu = <T extends object>({
icon={icon}
className={className}
title={title}
pressed={state.isOpen}
small
/>
{state.isOpen && (
Expand Down

0 comments on commit a608c8f

Please sign in to comment.