diff --git a/src/components/attribute-filter.tsx b/src/components/attribute-filter.tsx index 9b2e967..9e13909 100644 --- a/src/components/attribute-filter.tsx +++ b/src/components/attribute-filter.tsx @@ -50,6 +50,11 @@ export const AttributeFilter = () => { setHasFilter(anyFilters); },[frequencies, selectedAttrMap, selectedFrequency]); + //close filter modal if user changes selectedFrequency + useEffect(()=>{ + setShowFilterModal(false); + },[selectedFrequency]); + const handleFilterClick = (e: React.MouseEvent, index: number) => { const rect = e.currentTarget.getBoundingClientRect(); const top = rect.bottom + window.scrollY;