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

[TextareaAutosize] Temporarily un-observe element when resizing #44540

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Nov 25, 2024

Fixes #43718

Demo: https://codesandbox.io/p/sandbox/fix-textarea-ro-error-nslxvr (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 while it is being observed.

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.

@mui-bot
Copy link

mui-bot commented Nov 25, 2024

Netlify deploy preview

https://deploy-preview-44540--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 72a6aaa

@mj12albert mj12albert force-pushed the fix/textarea-ro-loop branch 4 times, most recently from ef2e707 to b152a03 Compare November 25, 2024 09:30
@mj12albert mj12albert changed the title [TextareaAutosize] Fix RO error [TextareaAutosize] Temporarily un-observe element when resizing Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TextareaAutosize The React component.
Projects
None yet
2 participants