DataTable: onValueChange fires if the selection if updated #5281
Labels
Resolution: Duplicate
Issue has already been reported or a pull request related to same issue has already been submitted
Milestone
Describe the bug
Since 10.0.x, onValueChange callback runs when the selected rows changes. Within my application, this is causing an infinite loop issue. According to DataTable api docs, onValueChange is "Callback to invoke after filtering and sorting to pass the rendered value."
Reproducer
https://codesandbox.io/p/sandbox/onvaluechange-infiniteloop-forked-7p94pj
PrimeReact version
10.0.x
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA) and Next.js 13.2.1 using pages router.
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
I expect onValueChange to only run if sorting or filtering happens. This behaves as expected in v9.6.0.
Same codesandbox as the reproducer, but with [email protected].
https://codesandbox.io/p/sandbox/onvaluechange-noinfiniteloop-gqq683
The text was updated successfully, but these errors were encountered: