Hide list controls when no items are selected (#40434)
* The Select all and Clear selection buttons are only displayed when at least 1 item is selected * Add changelog file
This commit is contained in:
parent
e65c5dbef4
commit
d8aa52d0a7
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
The Select all and Clear selection buttons are only displayed when at least 1 item is selected
|
|
@ -349,20 +349,24 @@ export const VariationsTable = forwardRef<
|
|||
/>
|
||||
</div>
|
||||
<div className="woocommerce-product-variations__filters">
|
||||
{ hasSelection( variationIds ) && (
|
||||
<>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
disabled={ areAllSelected( variationIds ) }
|
||||
onClick={ () => onSelectAll( variationIds )( true ) }
|
||||
onClick={ () =>
|
||||
onSelectAll( variationIds )( true )
|
||||
}
|
||||
>
|
||||
{ __( 'Select all', 'woocommerce' ) }
|
||||
</Button>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
disabled={ ! hasSelection( variationIds ) }
|
||||
onClick={ () => onClearSelection() }
|
||||
onClick={ onClearSelection }
|
||||
>
|
||||
{ __( 'Clear selection', 'woocommerce' ) }
|
||||
</Button>
|
||||
</>
|
||||
) }
|
||||
</div>
|
||||
<div>
|
||||
<VariationsActionsMenu
|
||||
|
|
Loading…
Reference in New Issue