Skip to content

Commit

Permalink
Close filter modal if user changes frequence
Browse files Browse the repository at this point in the history
  • Loading branch information
eireland committed Jan 31, 2024
1 parent ebf636a commit 760faa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/attribute-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>, index: number) => {
const rect = e.currentTarget.getBoundingClientRect();
const top = rect.bottom + window.scrollY;
Expand Down

0 comments on commit 760faa1

Please sign in to comment.