diff --git a/packages/mantine/src/components/table/TablePredicate.tsx b/packages/mantine/src/components/table/TablePredicate.tsx index e12b9ad4cf..c151d27d14 100644 --- a/packages/mantine/src/components/table/TablePredicate.tsx +++ b/packages/mantine/src/components/table/TablePredicate.tsx @@ -8,7 +8,7 @@ const useStyles = createStyles((theme) => ({ root: {}, wrapper: {}, label: {}, - select: {} + select: {}, })); type TablePredicateStylesNames = Selectors; @@ -40,10 +40,16 @@ export const TablePredicate: FunctionComponent = ({ ...others }) => { const {classes} = useStyles(null, {name: 'TablePredicate', classNames, styles, unstyled}); - const {form} = useTable(); + const {form, setState} = useTable(); - const onUpdate = (newValue: string) => { + const handleChange = (newValue: string) => { form.setFieldValue('predicates', {...form.values.predicates, [id]: newValue}); + setState((prevState) => ({ + ...prevState, + pagination: prevState.pagination + ? {pageIndex: 0, pageSize: prevState.pagination.pageSize} + : prevState.pagination, + })); }; return ( @@ -53,7 +59,7 @@ export const TablePredicate: FunctionComponent = ({