From f370b565c28cd114ed559c154e3715fa311b9d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Sat, 17 Aug 2024 20:43:27 -0300 Subject: [PATCH] fix: dropdown checkbox click area (#1215) --- src/search-manager/FilterByBlockType.tsx | 21 ++++---- src/search-manager/FilterByTags.tsx | 68 +++++++++++++----------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/src/search-manager/FilterByBlockType.tsx b/src/search-manager/FilterByBlockType.tsx index dc65c7ca86..f592b713ae 100644 --- a/src/search-manager/FilterByBlockType.tsx +++ b/src/search-manager/FilterByBlockType.tsx @@ -81,16 +81,17 @@ const FilterByBlockType: React.FC> = () => { { Object.entries(sortedBlockTypes).map(([blockType, count]) => ( - - {' '} - {count} - + )) } { diff --git a/src/search-manager/FilterByTags.tsx b/src/search-manager/FilterByTags.tsx index 476a07ed35..8535ab4485 100644 --- a/src/search-manager/FilterByTags.tsx +++ b/src/search-manager/FilterByTags.tsx @@ -49,38 +49,43 @@ const TagMenuItem: React.FC<{ const randomNumber = React.useMemo(() => Math.floor(Math.random() * 1000), []); const checkboxId = tagPath.replace(/[\W]/g, '_') + randomNumber; + const expandChildrenClick = React.useCallback((e) => { + e.preventDefault(); + onToggleChildren?.(tagPath); + }, [onToggleChildren, tagPath]); + return ( -
- - - { - hasChildren - ? ( - onToggleChildren?.(tagPath)} - variant="primary" - size="sm" - /> - ) : null - } -
+ ); }; @@ -125,7 +130,6 @@ const TagOptions: React.FC<{ return (