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 null #2063

Closed
2 tasks done
stunaz opened this issue Aug 2, 2020 · 2 comments
Closed
2 tasks done

Cannot read property 'scrollTop' of null #2063

stunaz opened this issue Aug 2, 2020 · 2 comments
Labels
bug 🐛 Something isn't working

Comments

@stunaz
Copy link
Contributor

stunaz commented Aug 2, 2020

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

when using StaticDatePicker along with a transition component like Fade... I get the error Cannot read property 'scrollTop' of null

Expected Behavior 🤔

No errors.

Steps to Reproduce 🕹

https://codesandbox.io/s/intelligent-chebyshev-gkke3?file=/src/App.jsx:441-448

Context 🔦

Your Environment 🌎

Tech Version
@material-ui/core v5 alpha 5
@material-ui/pickers v4 alpha 11
React latest
Browser any
TypeScript latest
etc.
@stunaz stunaz added the status: needs triage These issues haven't been looked at yet by a maintainer. label Aug 2, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 2, 2020

@stunaz Thanks for opening an issue. The issue is that the date picker components don't implement the forward ref pattern correctly. We keep track of the problem in #1604. For instance, in https://codesandbox.io/s/elegant-margulis-shdj8?file=/src/App.jsx, the ref should return the root element. But nothing happens. In some other components, the returned ref isn't the root element but some arbitrary nested element which would lead to similar issues.

Workaround: add a wrapping div.

@oliviertassinari oliviertassinari added bug 🐛 Something isn't working and removed status: needs triage These issues haven't been looked at yet by a maintainer. labels Aug 2, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 2, 2020

Also, please mind that, normally, we would get a warning https://codesandbox.io/s/dazzling-tereshkova-um6wm?file=/src/App.jsx. The problem is that StaticDatePicker has a React.forwardRef but does nothing with the ref.
We should use test/describeConformance.js as we move the picker into the main repository infrastructure, to put a constraint that will avoid regressions and assert the correct behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants