From 7136ddad039e38bc99a2cd0961ee9e8426269b16 Mon Sep 17 00:00:00 2001 From: rajkp Date: Tue, 20 Aug 2024 15:21:07 +0530 Subject: [PATCH] Check if filters exists or not when rendering the dropdown button --- packages/dataviews/src/components/dataviews-filters/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/dataviews/src/components/dataviews-filters/index.tsx b/packages/dataviews/src/components/dataviews-filters/index.tsx index de3477914c0083..96e7f5b5d7b9d9 100644 --- a/packages/dataviews/src/components/dataviews-filters/index.tsx +++ b/packages/dataviews/src/components/dataviews-filters/index.tsx @@ -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 (