Skip to content

Commit

Permalink
Data Views: Don't render action modal when there are no eligible items (
Browse files Browse the repository at this point in the history
#64250)


Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored and vcanales committed Sep 4, 2024
1 parent 4f335ff commit 87d361d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dataviews/src/bulk-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ function ActionWithModal< Item extends AnyItem >( {
const onCloseModal = useCallback( () => {
setActionWithModal( undefined );
}, [ setActionWithModal ] );

if ( ! eligibleItems.length ) {
return null;
}

const label =
typeof action.label === 'string'
? action.label
Expand Down

0 comments on commit 87d361d

Please sign in to comment.