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

Calling scrollTo on a VariableSizeGrid causes a crash/loop #63

Closed
ptlm500 opened this issue Oct 1, 2018 · 5 comments
Closed

Calling scrollTo on a VariableSizeGrid causes a crash/loop #63

ptlm500 opened this issue Oct 1, 2018 · 5 comments

Comments

@ptlm500
Copy link

ptlm500 commented Oct 1, 2018

Calling scrollTo on a VariableSizeGrid component seems to cause the page to crash, as seen in the following example:

https://codesandbox.io/s/ypq502woz9

I did notice, however, that there are no test cases for scrollTo on VariableSizeGrid components, so apologies if the two aren't meant to work together!

@ptlm500
Copy link
Author

ptlm500 commented Oct 1, 2018

So it looks like this happens when either scrollLeft or scrollTop are not passed to scrollTo.
Editing the sandbox to always provide a scrollLeft value fixes the issue:

https://codesandbox.io/s/m4n3y7x58

@bvaughn
Copy link
Owner

bvaughn commented Oct 1, 2018

The scrollTo method for Grid requires both scrollLeft and scrollTop values.

But I can see where it might be useful in some cases to only update one dimension. I'll add a test and fix for this.

@bvaughn
Copy link
Owner

bvaughn commented Oct 1, 2018

Implemented in 7c481d6

@bvaughn bvaughn closed this as completed Oct 1, 2018
@bvaughn
Copy link
Owner

bvaughn commented Oct 1, 2018

This fix was included in the 1.2.0 release

@savabozo
Copy link

savabozo commented Oct 6, 2019

Hi @bvaughn
Please update the docs with proper interface.

For example interface at https://react-window.now.sh/#/api/FixedSizeGrid
scrollTo({scrollLeft: number, scrollTop: number}): void
should be
scrollTo({scrollLeft?: number, scrollTop?: number}): void

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

No branches or pull requests

3 participants