primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Datatable: onValueChange with Removable Sort

Open kyybo opened this issue 2 years ago • 0 comments

Describe the bug

The onValueChange callback is triggered by sorting a column, which is fine. However, with the removableSort attribute, when you disable the sorting (third click on the column header) the onValueChange callback does not return the right values. It returns the values of the last call and not the initial values of the datatable (i.e. unsorted values).

Reproducer

Just create a Datatable with the attribute 'onValueChange={(filteredValues) => console.log(filteredValues)}' and a column with removableSort.

PrimeReact version

8.3.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

The onValueChange callback must return the unsorted values of the datatable when the sorting is deactivated.

kyybo avatar Aug 03 '22 13:08 kyybo