diff --git a/src/search-manager/FilterByBlockType.tsx b/src/search-manager/FilterByBlockType.tsx index 9ad27bc45..95c8ee756 100644 --- a/src/search-manager/FilterByBlockType.tsx +++ b/src/search-manager/FilterByBlockType.tsx @@ -224,6 +224,11 @@ const FilterByBlockType: React.FC = ({ disabled = false setProblemTypesFilter, } = useSearchContext(); + const clearFilters = useCallback(/* istanbul ignore next */ () => { + setBlockTypesFilter([]); + setProblemTypesFilter([]); + }, []); + useEffect(() => { if (disabled) { // Clear filters when disabled @@ -240,11 +245,6 @@ const FilterByBlockType: React.FC = ({ disabled = false return () => {}; }, [disabled]); - const clearFilters = useCallback(/* istanbul ignore next */ () => { - setBlockTypesFilter([]); - setProblemTypesFilter([]); - }, []); - // Sort blocktypes in order of hierarchy followed by alphabetically for components const sortedBlockTypeKeys = Object.keys(blockTypes).sort((a, b) => { const order = {