Skip to content

Commit

Permalink
DataViews: hide filter toggle if there are no filters (WordPress#64640)
Browse files Browse the repository at this point in the history
Unlinked contributors: [email protected].

Co-authored-by: oandregal <[email protected]>
Co-authored-by: imrraaj <[email protected]>
Co-authored-by: juanmaguitar <[email protected]>
  • Loading branch information
4 people authored and bph committed Aug 31, 2024
1 parent 675d146 commit 26cc3d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dataviews/src/components/dataviews-filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export function FilterVisibilityToggle( {
const visibleFilters = filters.filter( ( filter ) => filter.isVisible );

const hasVisibleFilters = !! visibleFilters.length;
if ( filters.length === 0 ) {
return null;
}
if ( ! hasVisibleFilters ) {
return (
<AddFilterDropdownMenu
Expand Down

0 comments on commit 26cc3d8

Please sign in to comment.