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

Invariant Violation Maximum update depth exceeded on TextareaAutosize with Meiryo font in Firefox #17385

Closed
hatanaka-akihiro opened this issue Sep 11, 2019 · 17 comments · Fixed by #17652
Labels
bug 🐛 Something doesn't work component: TextareaAutosize The React component. good first issue Great for first contributions. Enable to learn the contribution process. hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@hatanaka-akihiro
Copy link

Current Behavior 😯

This bug is similar with #16685.
With the specific font (Meiryo font), bug has not been fixed.

Firefox (69) NG
Chrome (76) OK.

Steps to Reproduce 🕹

https://codesandbox.io/s/create-react-app-c69fh

Your Environment 🌎

Tech Version
Material-UI v4.4.1
React v16.9.0
Firefox v69
Chrome v76
@hatanaka-akihiro
Copy link
Author

It seems that the bug occuring conditions are limited.

  • TextField contained with ExpansionPanel and ExpansionPanelDetails -> not occured.
  • TextField contained with Dialog and DialogContent -> occured.

@oliviertassinari oliviertassinari added the component: TextareaAutosize The React component. label Sep 12, 2019
@bitoverflow
Copy link

Investigation an issue related to this.
Resolved by removing the 'rows' attribute from TextField

@oliviertassinari
Copy link
Member

Could you confirm that this diff solves the problem?

diff --git a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.js b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.js
index 6634f0e6b2..6ac6e9742e 100644
--- a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.js
+++ b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.js
@@ -21,6 +21,8 @@ const styles = {
     height: 0,
     top: 0,
     left: 0,
+    // Create a new layer, increase the isolation of the computed values
+    transform: 'translateZ(0)',
   },
 };

I could reproduce the problem on Firefox v69 with a zoom of 133%. Otherwise, removing the possibility for an infinite rendering loop, as proposed in this comment #16685 (comment) sounds good to me too.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. labels Sep 13, 2019
@hatanaka-akihiro
Copy link
Author

@oliviertassinari

I tried this diff.
I confirmed the bug was not occurred.
'translateZ()' CSS function will fix the bug.

@oliviertassinari
Copy link
Member

Nice, do you want to submit a pull request?

@bitoverflow would it solve your issue too?

@hatanaka-akihiro
Copy link
Author

@oliviertassinari

I think it is better that material-ui library includes this bug fix.

@oliviertassinari
Copy link
Member

@hatanaka-akihiro agree, do you want to make it happen?

@hatanaka-akihiro
Copy link
Author

@oliviertassinari Yes.

@bitoverflow
Copy link

bitoverflow commented Sep 17, 2019

@oliviertassinari

The patch did not solve it for us, but are starting to see a pattern on what is triggering it

  • The screen needs to have a wide resolution
  • The width of the browser window needs to have an odd number (over 1050px)

..strange things

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 17, 2019

@bitoverflow Thanks, in this case, I think that we can also remove the infinite loop potential with #16685 (comment). I'm tired of seeing this class of issue report. It seems that layout text measurement is instable, we can accept it and move on.

@joziahg
Copy link

joziahg commented Sep 19, 2019

A user of mine is also having this issue, they are on Firefox 69, newish macbook air.
Setting zoom to 80% stops it from crashing and having the console open stops if from crashing. Will keep troubleshooting to see what else is a factor.
I am also on Firefox 69, windows 10 and am not having this issue.

@bitoverflow
Copy link

Are now also seeing this in Internet Explorer 11.
Triggered a little different.

TextField with multiline, rows 3, inside a Dialog. Crashes when user fills the area with text and it needs to grow.

Stabilize by removing the rows parameter

@oliviertassinari
Copy link
Member

Does somebody want to work on the problem and submit a pull request?

@bitoverflow
Copy link

I am still seeing this in 4.5.0 with IE11
rows=3. Crashes with Maximum update depth exceeded when typing the TexField full
Sandbox are not loading in IE11, så are not able to give an example

@oliviertassinari
Copy link
Member

Solving IE 11 wasn't an expectation of the issue nor the pull request.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 2, 2019

@bitoverflow If you have a reproduction (the sources maybe?), we would appreciate it. This issue was about Firefox.

@bitoverflow
Copy link

@oliviertassinari Created a new issue #17672 with demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: TextareaAutosize The React component. good first issue Great for first contributions. Enable to learn the contribution process. hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants