diff --git a/src/components/Filters/CategoryFilterPopup.tsx b/src/components/Filters/CategoryFilterPopup.tsx index 820caa0..efb833e 100644 --- a/src/components/Filters/CategoryFilterPopup.tsx +++ b/src/components/Filters/CategoryFilterPopup.tsx @@ -405,10 +405,22 @@ const CategoryCheckbox: React.FC = ({ const anyChildCombinationSelected = childPaths.some((childPath) => selectedCombinations.includes(childPath) ) - setIsIndeterminate( - anyChildCombinationSelected && !selectedCombinations.includes(pathString) + const anyChildCombinationLinked = childPaths.some( + (childPath) => + linkedHierarchy !== null && linkedHierarchy.includes(childPath) ) - }, [category, name, path, selectedCombinations, selectedSingles]) + setIsIndeterminate( + (anyChildCombinationSelected || anyChildCombinationLinked) && + !selectedCombinations.includes(pathString) + ) + }, [ + category, + linkedHierarchy, + name, + path, + selectedCombinations, + selectedSingles + ]) const handleSingleChange = () => { setIsSingleChecked(!isSingleChecked)