diff --git a/src/components/accessories/table/Table.tsx b/src/components/accessories/table/Table.tsx index f5bd9d6ea..8427f3101 100644 --- a/src/components/accessories/table/Table.tsx +++ b/src/components/accessories/table/Table.tsx @@ -37,10 +37,10 @@ import { import { TOrder } from "../../../libraries/sortUtils/types"; import Button from "../button/Button"; import ConfirmationDialog from "../confirmationDialog/ConfirmationDialog"; +import TableBodyRow from "./TableBodyRow"; import { FilterButton } from "./filter/FilterButton"; import { TFilterValues } from "./filter/types"; import "./styles.scss"; -import TableBodyRow from "./TableBodyRow"; import { IProps, TActions } from "./types"; const Table: FunctionComponent = ({ @@ -399,7 +399,7 @@ const Table: FunctionComponent = ({ field={filterField} onChange={(value) => setFilters((previous) => ({ - ...filters, + ...previous, [filterField.key]: value, })) } diff --git a/src/components/accessories/table/filter/FilterButton.tsx b/src/components/accessories/table/filter/FilterButton.tsx index 7c00a6e9b..38cba46ee 100644 --- a/src/components/accessories/table/filter/FilterButton.tsx +++ b/src/components/accessories/table/filter/FilterButton.tsx @@ -100,7 +100,11 @@ export const FilterButton = ({ field, onChange }: IOwnProps) => { }; useEffect(() => { - formik.submitForm(); + const submit = setTimeout(() => { + formik.submitForm(); + }, 250); + + return () => clearInterval(submit); }, [formik.values]); return (