Skip to content

Commit

Permalink
Menu granular subcomponents: Refactor dataviews list layout actions m…
Browse files Browse the repository at this point in the history
…enu (#67639)

Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: oandregal <[email protected]>
  • Loading branch information
4 people authored Dec 12, 2024
1 parent 7ec1bdd commit e417829
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions packages/dataviews/src/dataviews-layouts/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,30 +198,34 @@ function ListItem< Item >( {
) }
{ ! hasOnlyOnePrimaryAction && (
<div role="gridcell">
<Menu
trigger={
<Composite.Item
id={ generateDropdownTriggerCompositeId(
idPrefix
) }
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
onKeyDown={ onDropdownTriggerKeyDown }
/>
}
/>
}
placement="bottom-end"
>
<ActionsMenuGroup
actions={ eligibleActions }
item={ item }
<Menu placement="bottom-end">
<Menu.TriggerButton
render={
<Composite.Item
id={ generateDropdownTriggerCompositeId(
idPrefix
) }
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
onKeyDown={
onDropdownTriggerKeyDown
}
/>
}
/>
}
/>
<Menu.Popover>
<ActionsMenuGroup
actions={ eligibleActions }
item={ item }
/>
</Menu.Popover>
</Menu>
</div>
) }
Expand Down

0 comments on commit e417829

Please sign in to comment.