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

Cannot read property 'scrollTop' of undefined #64

Closed
ghengeveld opened this issue Sep 14, 2020 · 5 comments · Fixed by #65
Closed

Cannot read property 'scrollTop' of undefined #64

ghengeveld opened this issue Sep 14, 2020 · 5 comments · Fixed by #65
Labels

Comments

@ghengeveld
Copy link

ghengeveld commented Sep 14, 2020

Oftentimes, parentRef will have value undefined at first render. This breaks with TypeError: Cannot read property 'scrollTop' of undefined in react-virtual 2.2.4 and above. It works fine in 2.2.3.

See for example: https://codesandbox.io/s/trusting-shamir-05gpx
Changing to react-virtual 2.2.3 fixes it.

@kentcdodds
Copy link
Member

I think I've seen this as well. This is the change: v2.2.3...v2.2.4

Specifically, this is the line that's causing the issue: v2.2.3...v2.2.4#diff-1fdf421c05c1140f6d71444ea2b27638R74

@kentcdodds
Copy link
Member

Made a PR to help out a bit.

@tannerlinsley
Copy link
Collaborator

🎉 This issue has been resolved in version 2.2.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghengeveld
Copy link
Author

ghengeveld commented Sep 15, 2020

I'm running into a new issue now: Cannot read property 'addEventListener' of undefined
See https://codesandbox.io/s/storybook-search-virtualized-jyq1u?file=/src/Tree.js (change to react-virtual 2.2.6)
Might just be my code though. Virtualizing a tree is hard.

@kentcdodds
Copy link
Member

We should probably add a test for this use case 😅

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.

3 participants