Skip to content

Fixing infinite loop re-renders in TextField multiline auto resize#38453

Closed
stouch wants to merge 1 commit intomui:masterfrom
stouch:bug/textarea-autosize-react18-issue-infinite-loop
Closed

Fixing infinite loop re-renders in TextField multiline auto resize#38453
stouch wants to merge 1 commit intomui:masterfrom
stouch:bug/textarea-autosize-react18-issue-infinite-loop

Conversation

@stouch
Copy link

@stouch stouch commented Aug 13, 2023

Fixing #33081

For the record, a PR was previously made trying to fix this issue: https://github.com/mui/material-ui/pull/33253/files

@mui-bot
Copy link

mui-bot commented Aug 13, 2023

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 68691c8

@zannager zannager added the scope: text field Changes related to the text field. label Aug 14, 2023
@zannager zannager requested a review from michaldudak August 14, 2023 10:41
@michaldudak
Copy link
Member

I could not reproduce the issue using the latest Material UI version (5.14.5): https://codesandbox.io/s/loving-breeze-q8n2cl
Could you verify it's still a problem?

@emrebal98
Copy link

I think you need to specify long default value for it. https://codesandbox.io/s/sleepy-lalande-ds226x

@michaldudak
Copy link
Member

I still can't reproduce it.
@DiegoAndai would you mind taking a look at it?

@DiegoAndai DiegoAndai self-requested a review August 28, 2023 21:03
@DiegoAndai
Copy link
Member

DiegoAndai commented Aug 30, 2023

I cannot repro #33081 on 5.14.7, but the example provided in #38453 (comment) does show the error. This is a different bug for long default values.

@stouch, thanks for working on this. Could you explain how/why adding the value to the dependency array fixes it? As this is a different bug, please create the issue with the repro steps

@megatron-hoa-tp-frontend
Copy link

megatron-hoa-tp-frontend commented Oct 3, 2023

Hi @DiegoAndai @michaldudak
I got the same this issue
You can take a look this reproduce
https://codesandbox.io/s/mutable-frog-q8qr23?file=/src/App.tsx
I hope this will be fixed soon
Thanks

image

@michaldudak
Copy link
Member

@megatron-hoa-tran Thanks! I can see the error in your reproduction. This PR does fix it, however, it breaks some other tests. @stouch, could you take a look at them?

@megatron-hoa-tp-frontend
Copy link

megatron-hoa-tp-frontend commented Oct 10, 2023

@stouch @michaldudak
I'm stuck by this one
Could you take a look at them?
Please check this soon 🙏
Thank you

@DiegoAndai
Copy link
Member

Hey @megatron-hoa-tran, there's still broken tests. Let's wait to see if @stouch can keep working on this. Otherwise, I encourage you to review the broken tests if you have some time so we can move forward 😊

I would also like to know how/why adding the value to the dependency array fixes the issue, especially because the error also appears when defaultValue is a long string. I would like to understand the root cause of the issue before merging a solution.

@ZeeshanTamboli
Copy link
Member

@stouch Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: text field Changes related to the text field.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants