Skip to content

Commit

Permalink
Column filter: do not allow removing the filter
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 15, 2023
1 parent b2ea056 commit 141d4a4
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions packages/edit-site/src/components/dataviews/view-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,29 +211,6 @@ function HeaderMenu( { dataView, header } ) {
</DropdownMenuItemV2>
);
} ) }
<DropdownMenuSeparatorV2 />
<DropdownMenuItemV2
key="remove-filter"
onSelect={ () => {
const otherFilters = dataView
.getState()
.columnFilters?.filter( ( f ) => {
const [ field, operator ] =
Object.keys( f )[ 0 ].split(
':'
);
return (
field !== filter.field ||
operator !== 'in'
);
} );
dataView.setColumnFilters( [
...otherFilters,
] );
} }
>
{ __( 'Remove' ) }
</DropdownMenuItemV2>
</DropdownSubMenuV2>
</DropdownMenuGroupV2>
) }
Expand Down

0 comments on commit 141d4a4

Please sign in to comment.