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 #1159: CollectionView scrollTop/scrollLeft #1260

Merged

Conversation

dawnmist
Copy link
Contributor

@dawnmist dawnmist commented Nov 6, 2018

Props scrollTop/scrollLeft are only applied when this.state.scrollPositionChangeReason is REQUESTED, but getDerivedStateFromProps was not setting scrollPositionChangeReason. This meant that these props were not being applied to the view.

Thanks for contributing to react-virtualized!

Before submitting a pull request, please complete the following checklist:

  • The existing test suites (npm test) all pass
  • For any new features or bug fixes, both positive and negative test cases have been added
  • For any new features, documentation has been added - N/A
  • For any documentation changes, the text has been proofread and is clear to both experienced users and beginners - N/A
  • Format your code with prettier (npm run prettier).
  • Run the Flow typechecks (npm run typecheck).

closes #1159

@dawnmist dawnmist requested a review from bvaughn February 9, 2020 13:00
@rstoneIDBS
Copy link

Has this PR slipped through the cracks? We would love to be able to switch to the latest version, but without this fix we either have to patch or stick on 9.18.5

Props scrollTop/scrollLeft are only applied to CollectionView when
this.state.scrollPositionChangeReason is REQUESTED, but
getDerivedStateFromProps was not setting scrollPositionChangeReason.
This meant that these props were not being applied to the view.
@dawnmist dawnmist force-pushed the bugfix/1159-collection-scrollTop-scrollLeft branch from 17ea8f3 to f40bc0d Compare June 17, 2020 01:31
To check that scrollPositionChangeReason is being set properly when setting
scrollLeft or scrollTop parameters on Collection - if it is not set, the
view does not actually apply the given scrollLeft or scrollTop parameters.
@dawnmist
Copy link
Contributor Author

As far as I know, no-one has ever reviewed it - I've certainly never received any form of feedback ever since the initial labelling of the bug 2 years ago.

The only reason I can think of for the issue was that at the time of creating the pull request I hadn't been able to get puppeteer working, hence couldn't run the tests properly locally, and the count of checkboxes on the pull requests list page therefore wasn't "correct".

I've updated the pull request to current master, and updated the tests that were incorrectly passing on master (because they were not checking the scrollPositionChangeReason from state that is required for the scrollTop and scrollLeft values to be actually used). These tests now fail on master, but are passing with the pull request.

It is my hope that after 18 months waiting for a review (or almost 2 years waiting for any action on the bug report) that the test changes will finally trigger this into being looked at. It feels really awful to try to contribute and simply be ignored entirely despite a critical bug having been introduced that even with a fully worked example doesn't get any action and a 2 line pull request fixing it doesn't get any feedback as to why it is being left untouched/unreviewed.

We're still stuck on react-virtualized 9.18.5 because the implementation of getDerivedStateFromProps for the CollectionView component has been fundementally broken ever since it was written.

@sid-ag5
Copy link

sid-ag5 commented Aug 10, 2020

We have also been stuck on 9.18.5 for a while now because of this issue, and we want to be prepared for concurrent mode when it comes along.

@wuweiweiwu Can this be looked into? It's a very blocking issue and seems to be going unnoticed.

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.

Thanks for this fix!

@wuweiweiwu wuweiweiwu merged commit ffc191c into bvaughn:master Aug 10, 2020
@wuweiweiwu
Copy link
Contributor

Will release and update!

@wuweiweiwu
Copy link
Contributor

released! https://www.npmjs.com/package/react-virtualized/v/9.22.2 hope the update process is smooth

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.

Setting scrollTop/scrollLeft on a Collection does not scroll in 9.19.0 or later.
4 participants