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

ignores defaultValue property changes #11150

Closed
1 task done
dogada opened this issue Apr 26, 2018 · 4 comments
Closed
1 task done

ignores defaultValue property changes #11150

dogada opened this issue Apr 26, 2018 · 4 comments
Labels
core Infrastructure work going on behind the scenes discussion out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)

Comments

@dogada
Copy link

dogada commented Apr 26, 2018

TextField properly paints defaultValue first time but ignores all further updates of defaulltValue.

See the demo of the bug:

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

TextField should always show current defaultValue.

Current Behavior

Only initial defaultValue is shown, all updates are ignored.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/r50qpkywkp

  1. See that value of text field isn't changed after timeout (when defaultValue is changed).

Context

The real use case is to paint empty form, then load data via AJAX and fill in form.
Some libs (for example https://github.com/jeanlescure/material-ui-schema-form) uses TextField's defaultValue for initial field rendering, so if you update defaultValue property for already mounted TextField, the new value is simply ignored.

Your Environment

The latest version of Material-UI next branch and React. Any browser.

@oliviertassinari oliviertassinari added out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future) component: text field This is the name of the generic UI component, not the React module! labels Apr 26, 2018
@oliviertassinari

This comment has been minimized.

@HelloLove
Copy link

@oliviertassinari native input defaultValue without value property is always update

@oliviertassinari
Copy link
Member

@HelloLove Do you have an example that supports this claim? It's not working here https://codesandbox.io/s/q9vlvxjw54.

@esabunor
Copy link

Hi thanks for your hardwork on this project,
I have this issue is there a solution I can apply to my project.
Thanks.

@oliviertassinari oliviertassinari changed the title TextField ignores defaultValue property changes ignores defaultValue property changes Apr 26, 2020
@oliviertassinari oliviertassinari added core Infrastructure work going on behind the scenes discussion and removed component: text field This is the name of the generic UI component, not the React module! labels Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes discussion out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)
Projects
None yet
Development

No branches or pull requests

4 participants