Skip to content

Commit

Permalink
fix(ListItemBase): Clicking on actions wasn't toggling the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Mar 23, 2023
1 parent 633ecf8 commit 3fbfa31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion react/MuiCozyTheme/ListItem/ListItemBase/index.jsx
Expand Up @@ -33,6 +33,8 @@ const ListItemBase = ({
const anchorRef = useRef()
const { isMobile } = useBreakpoints()

const toggleMenu = () => setShowActionMenu(v => !v)

const showActionMenuHeader = isMobile && actionMenuComp?.Header
const isButton = !isRenaming && !!onClick
const handleClick =
Expand All @@ -57,7 +59,7 @@ const ListItemBase = ({
)}
{actions && !isSelectActive && (
<ListItemSecondaryAction>
<IconButton ref={anchorRef} onClick={() => setShowActionMenu(true)}>
<IconButton ref={anchorRef} onClick={toggleMenu}>
<Icon icon={DotsIcon} />
</IconButton>
</ListItemSecondaryAction>
Expand Down

0 comments on commit 3fbfa31

Please sign in to comment.