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 create multi sort bug #1051

Merged
merged 4 commits into from
Jul 27, 2018

Conversation

lideeyaa
Copy link
Contributor

@lideeyaa lideeyaa commented Mar 15, 2018

This PR fixes a bug found in the createMultiSort function. When selecting a new column to sort, the original code clears the sortBy array of all non-selected keys, however, fails to clear the sortDirection object. By failing to do so, multi-select will not work on any future shift+clicks. Let me explain: in the event.shiftClick if-statement block starting on line 59, since the old keys remain in the sortDirection object, it will never push the new column value to the sortBy array, and thus only ever returning one key in sortBy. In my PR, I make sure the sortDirection object is cleared of all the non-selected key-values.

Lydia Cheung added 2 commits March 15, 2018 12:12
@aem
Copy link
Contributor

aem commented Mar 15, 2018

Hi there! Can you please add some positive and negative test cases to verify your PR's changes? That will help track if this breaks in the future

@mikeldking
Copy link

I can confirm this bug. @aem it would be awesome if this can get merged! Also thanks @lideeyaa for the fix.
multisortbug

Copy link
Contributor

@wuweiweiwu wuweiweiwu left a comment

Choose a reason for hiding this comment

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

LGTM!

@wuweiweiwu
Copy link
Contributor

@lideeyaa Thanks for contributing! Planning to release this soon!

@wuweiweiwu wuweiweiwu merged commit c646a62 into bvaughn:master Jul 27, 2018
@lideeyaa
Copy link
Contributor Author

Glad I could help! :)

errendir added a commit to IdeaFlowCo/react-virtualized that referenced this pull request Oct 24, 2018
* bvaughn/master: (54 commits)
  Update version and changelog for 9.21.0 release (bvaughn#1252)
  chore: update lockfile
  Update ci badge (bvaughn#1227)
  Allow users to override default table row styles (bvaughn#1175)
  Add onColumnClick to Table (bvaughn#1207)
  remove unused variable in Masonry.example.js (bvaughn#1218)
  Fix Table aria attributes (bvaughn#1208)
  Fix typo in CellMeasurer.DynamicHeightTableColumn.example.js (bvaughn#1190)
  Update usingAutoSizer.md (bvaughn#1186)
  Add an extra check for an e.target.className.indexOf function (bvaughn#1210)
  Fix broken Slack badge image (bvaughn#1205)
  docs(CellMeasurer): fix `import` statement (bvaughn#1187)
  Added new friend (bvaughn#1197)
  Fix createMultiSort bug (bvaughn#1051)
  adding new usecase example and fix some typos (bvaughn#1168)
  Updating version to 9.20.1
  Update changelog for the 9.20.1 release (bvaughn#1167)
  Prevent early debounceScrollEndedCallback when there is a slow render (bvaughn#1141)
  removing sideEffects (bvaughn#1163)
  fix for bvaughn#998 with test cases (bvaughn#1154)
  ...
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 this pull request may close these issues.

4 participants