Skip to content

Commit

Permalink
Merge pull request #1400 from cityofaustin/17956-and-or-chip
Browse files Browse the repository at this point in the history
Add ability to toggle filters on any or all in the search filters chips
  • Loading branch information
chiaberry authored Aug 29, 2024
2 parents 0945463 + a4c5d5c commit 6451823
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions moped-editor/src/components/GridTable/FiltersChips.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ const FiltersChips = ({
}
};

/**
* Triggered by Filter Chip any/all click
* Sets the IsOr state and the url params state to be the opposite of current isOr state
*/
const toggleIsOrOnClick = () => {
setIsOr(!isOr);
setSearchParams((prevSearchParams) => {
prevSearchParams.set(advancedSearchIsOrParamName, !isOr);
return prevSearchParams;
});
};

return (
<Box className={classes.filtersList}>
<Typography className={classes.filtersText} component="span">
Expand All @@ -101,6 +113,8 @@ const FiltersChips = ({
<Grid item>
<Chip
variant="outlined"
color="primary"
onClick={toggleIsOrOnClick}
label={
isOr ? (
<>
Expand Down

0 comments on commit 6451823

Please sign in to comment.