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

TextField Label shrinked on state update #15713

Closed
gfsd3v opened this issue May 15, 2019 · 5 comments · Fixed by #17680
Closed

TextField Label shrinked on state update #15713

gfsd3v opened this issue May 15, 2019 · 5 comments · Fixed by #17680
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!

Comments

@gfsd3v
Copy link

gfsd3v commented May 15, 2019

Hello guys, I'm making a multi step form where I have the current step in the state and a function that changes the TextFields that are shown accordingly to the step state. The issue that i'm having is if any TextField that inherit the position of a TextField with a startAdornment has is label shrinked.
Bug GIF

Steps to Reproduce 🕹

You can reproduce the error on the codesandbox below, just click in the next button https://codesandbox.io/s/suspicious-mestorf-64m8k2mvxr

Thanks for the help and for the awesome project, much love <3

@oliviertassinari oliviertassinari added component: text field This is the name of the generic UI component, not the React module! discussion labels May 15, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented May 15, 2019

@gfsd3v We have had a similar discussion about the problem in #15386 (comment) cc @eps1lon.

You can work around the problem by adding a key to the fragment: https://codesandbox.io/s/label-shrink-bug-with-start-adornament-376c1.

@gfsd3v
Copy link
Author

gfsd3v commented May 15, 2019

@oliviertassinari Now I understood what was happening, thank you so much for the help and I'm sorry I wasn't able to find #15386, I'll be more thoroughly in my searches next time, thanks again.

@gfsd3v gfsd3v closed this as completed May 15, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented May 15, 2019

@gfsd3v No problem, no need to be sorry! Well, we might be able to find a better solution, but it's not obvious to me.

@eps1lon eps1lon added the docs Improvements or additions to the documentation label May 15, 2019
@eps1lon
Copy link
Member

eps1lon commented May 15, 2019

That's probably one case where we should actually fix it. It's not apparent in the code that react doesn't think it should re-mount those components. The problem is that label can be any renderable node so putting it into effect dependencies might be overzealous.

It's probably best to add a section in our docs since this is a very common issue.

@oliviertassinari
Copy link
Member

We have explored a solution in #17680 that seems to be good enough, it will likely solve this problem.

@oliviertassinari oliviertassinari removed the docs Improvements or additions to the documentation label Dec 2, 2019
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: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants