You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In that case, if we go to the 2nd page and looked at the values return by the onSelectionChange event onSelectionChange={(e) => console.log(e.value)}, we will see that :
with a simple click or with Ctrl+click (ctrlKey), the returned values have a correct rowIndex which match with the pagination. (in the example above, a click on the first element of the 2nd page will have rowIndex=5)
with Shift+click, the returned values have a rowIndex which doesn't correspond with the pagination. (in the example above, a shift+click on the first element of the 2nd page will have rowIndex=0)
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Oct 2, 2022
Describe the bug
I noticed that the onSelectionChange event of the Datatable component returns values with a bad 'rowIndex' attribute in some cases.
For example : a Datatable where multiple cell selection with MetaKey is activated and we have a pagination.
In that case, if we go to the 2nd page and looked at the values return by the onSelectionChange event
onSelectionChange={(e) => console.log(e.value)}
, we will see that :Reproducer
https://codesandbox.io/embed/nervous-wind-g8lygm?fontsize=14&hidenavigation=1&theme=dark
PrimeReact version
8.6.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
A Shift+click selection should return values with a rowIndex matching the pagination.
The text was updated successfully, but these errors were encountered: