Skip to content

Commit

Permalink
Fix primefaces#1396: onValueChanged called on filter state change
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 25, 2022
1 parent 9e2af29 commit 4e3ca98
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,14 @@ export const DataTable = React.forwardRef((props, ref) => {
}, [attributeSelectorState]);

useUpdateEffect(() => {
setFiltersState(cloneFilters(props.filters));
const filters = cloneFilters(props.filters);

setFiltersState(filters);
setD_filtersState(cloneFilters(props.filters));

if (props.onValueChange) {
props.onValueChange(processedData({ filters }));
}
}, [props.filters]);

useUpdateEffect(() => {
Expand Down

0 comments on commit 4e3ca98

Please sign in to comment.