question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Input] Input ignores defaultValue props changes in certain cases

See original GitHub issue

This 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jraoultcommented, Sep 16, 2018

@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.

1reaction
oliviertassinaricommented, Sep 15, 2018

@jraoult I confirm your analysis, thanks for sharing. It can be easily fixed then 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found