Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row select malfunction with initial selecting of rows and column sorting #767

Closed
b1rt opened this issue Jul 13, 2019 · 2 comments · Fixed by #768
Closed

Row select malfunction with initial selecting of rows and column sorting #767

b1rt opened this issue Jul 13, 2019 · 2 comments · Fixed by #768
Assignees
Labels

Comments

@b1rt
Copy link

b1rt commented Jul 13, 2019

After initial row selection (by option "rowsSelected") and initial sorting (by "options: {sortDirection: 'asc'}"), when you try to select or unselect row, changes are made to entirely different row.
After clearing selection, selecting of rows works fine.

My guess is that initial selection happens before sorting, thus indexes in selectedRowsData are not the same as in the displayed data.

Expected Behavior

After first render of table with sorting and initial selection, when you select\unselect any row, changes are made to this row.

Current Behavior

After first render of table with sorting and initial selection, when you select\unselect any row, changes are made to different row.

Snapshot of options

const tableColumns = [
    {name: 'Column1', options: {sortDirection: 'asc'}},
    {name: 'Column2'},
  ];

  const tableOptions = {
    selectableRows: true,
    rowsSelected: [0, 1, 2],

Environment

Tech Version
Material-UI 3.3.1
MUI-datatables 2.6.2
React 16.8.6
browser Chrome
@gabrielliwerant
Copy link
Collaborator

Thank you for reporting this, I should have a fix soon.

@gabrielliwerant
Copy link
Collaborator

Should be fixed in 2.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants