Skip to content

Commit

Permalink
feat: Keep filter status on close
Browse files Browse the repository at this point in the history
  • Loading branch information
mfanselmo committed Oct 11, 2024
1 parent 0cc8988 commit 277b849
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ui/src/DataTable/FilterAndSortMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ const FilterAndSortMenu = ({
currentFilter
}) => {
const [selectedFilter, setSelectedFilter] = useState(
camelCase(getFilterMenuItems(dataType)[0])
currentFilter?.selectedFilter ?? camelCase(getFilterMenuItems(dataType)[0])
);
const [filterValue, setFilterValue] = useState(
currentFilter?.filterValue ?? ""
);
const [filterValue, setFilterValue] = useState("");

const handleFilterChange = selectedFilter => {
if (
Expand Down

0 comments on commit 277b849

Please sign in to comment.