[Input] Input ignores defaultValue props changes in certain cases
See original GitHub issueThis is not a duplicate of #11150 .
- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
If an Input
is mounted with defaultValue
of undefined
, null
or ''
, it should display new defaultValue
passed to it.
Current Behavior
If an Input
is mounted with defaultValue
of undefined
, null
or ''
, it displays nothing when defaultValue
changes.
Example
This is an example of the difference between native <input>
and MUI <Input>
:
https://codesandbox.io/s/4q92mr55xw
Your Environment
Tech | Version |
---|---|
Material-UI | latest |
React | latest |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
[Input] Input ignores defaultValue props changes in certain ...
If an Input is mounted with defaultValue of undefined , null or '' , it should display new defaultValue passed to it. Current...
Read more >defaultValue of Input not working correctly on ant design
I had this problem when creating data-grid, and couldn't see the defaultValue for the first input.
Read more >TextInput - React Native
TextInput. A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >Default Props in React/TypeScript - DEV Community
I've set a default value of 'yo' on props.optionalString . And inside getLetterArrayFromOptionalString() , I'm trying to split() that string ...
Read more ><input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oliviertassinari haha, I wasn’t sure if it was a wink-wink kinda message 😃 Yeah, I think I should. Even just to give back a little bit to this amazing project.
@jraoult I confirm your analysis, thanks for sharing. It can be easily fixed then 😃