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

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

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

@oliviertassinari oliviertassinari added the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Aug 13, 2023
@zannager zannager added the component: text field This is the name of the generic UI component, not the React module! label Aug 14, 2023
@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-tran
Copy link

megatron-hoa-tran 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-tran
Copy link

megatron-hoa-tran 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
component: text field This is the name of the generic UI component, not the React module! PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants