Skip to content

Commit

Permalink
Revert "Suggestion: Let ResetFilter ignore undefined filters"
Browse files Browse the repository at this point in the history
This reverts commit 53fc637.
  • Loading branch information
oandregal committed Jan 30, 2024
1 parent 53fc637 commit 4d78f9c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/dataviews/src/reset-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

function hasActiveFilters( view ) {
return (
view.search !== '' ||
view.filters?.some( ( { value } ) => value !== undefined )
);
}

export default function ResetFilter( { view, onChangeView } ) {
return (
<Button
disabled={ ! hasActiveFilters( view ) }
disabled={ view.search === '' && view.filters?.length === 0 }
__experimentalIsFocusable
size="compact"
variant="tertiary"
Expand Down

0 comments on commit 4d78f9c

Please sign in to comment.