-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][TextareaAutosize] Temporarily disconnect ResizeObserver to avoid loop error #44540
base: master
Are you sure you want to change the base?
Conversation
e712092
to
e2d5825
Compare
Netlify deploy previewhttps://deploy-preview-44540--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
b152a03
to
72a6aaa
Compare
72a6aaa
to
d140f30
Compare
d140f30
to
044a802
Compare
@@ -36,15 +36,20 @@ type TextareaStyles = { | |||
overflowing: boolean; | |||
}; | |||
|
|||
function isObjectEmpty(object: TextareaStyles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5b99446
to
3a7aaf2
Compare
@mj12albert since this was hard to reproduce and might have some edge cases, can you add a comment in the related issue (#43718) to see if some users can test with this PR's version? They'd need to install |
Added ~ #43718 (comment) |
e2af729
to
cdaa830
Compare
44de4da
to
b571946
Compare
b571946
to
b540ceb
Compare
d84fef6
to
239b54b
Compare
239b54b
to
5196ed1
Compare
Fixes #43718
Fixes #44140
Demo: https://codesandbox.io/p/sandbox/immutable-architecture-nslxvr?file=%2Fsrc%2FApp.js%3A33%2C1 (forked from the original repro)
This was very hard to repro locally, but I believe the "loop" is caused when we change the height of the element in the RO callback, while it is still being observed, which fires the callback again (and again…)
The fix is to un-observe the element, manipulate the height then re-observe one frame later, instead of manipulating the height one frame later suggested here (or here).