mui / mui/material-ui

[transitions] "Cannot read property `scrollTop` of null"

Open
#27,154 22 comments 22 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Jul 8, 2021.

docs scope: transitions v5.x migration waiting for 👍
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

  • 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 😯

If the child of components does not forwardRef to DOM, it cause this error.

Screen Shot 2564-07-07 at 09 24 14

Expected Behavior 🤔

The error should be more informative about how to fix it.

Steps to Reproduce 🕹

Steps:

  1. open this sandbox https://codesandbox.io/s/transition-v5-error-dide8?file=/src/App.tsx
  2. change material-ui/core to v5.beta
  3. will see the error

Context 🔦

Is it better to display warning (in console) instead of Error?

Here is what I think about the dev experience.

  • write the code (use Transition the wrong way, no forwardRef for child)
  • check in browser, it does not work (the ui display without transitioning)

then, 3 possibilities

  • they see the warning in console about why it does not work and link to full doc example
  • they go to Transition docs
  • worse case, they open the issue
Actions
  • #27318

Your Environment 🌎

`npx @material-ui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.