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

fix: delete-many keep selected items #2774

Merged
merged 1 commit into from
Jan 16, 2019
Merged

fix: delete-many keep selected items #2774

merged 1 commit into from
Jan 16, 2019

Conversation

g3offrey
Copy link
Contributor

Hi and happy new year to you 😄

I'm opening this pull request as I encountered a bug.
When I'm selecting rows in <List> and using the default "bulk delete" button, the rows disappear but the "header" still show "X item selected", until I refresh the page.

kapture 2019-01-16 at 12 28 19

I investigated and found the issue.
It seems this code is not working as we are passing an array to indexOf.

const index = previousState.indexOf(action.payload.ids);	
if (index === -1) {	
  return previousState;	
}

I deleted it as this test seems useless in DELETE_MANY case.

Hope this is good ! 👌
Don't hesitate to tell me if I can do something more with this PR.

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@djhi djhi added this to the 2.6.2 milestone Jan 16, 2019
@djhi djhi merged commit 796848f into marmelab:master Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants