Skip to content

Commit

Permalink
Merge pull request #50 from concord-consortium/186951908-fix-filter-m…
Browse files Browse the repository at this point in the history
…odal-units

Close filter modal if user changes frequency
  • Loading branch information
lublagg authored Feb 1, 2024
2 parents 55b7640 + 760faa1 commit 85e66ab
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 85e66ab

Please sign in to comment.