material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Setting Default Value on Input through prop updates

Open yhbrandon opened this issue 11 years ago • 2 comments

Currently the Input component assigns a value by setting the prop defaultValue to the state of value on initialization. This prevents the ability to update the value post initialization through props specifically, forcing the user to hold this component to set value on it. This is somewhat cumbersome and could be alleviated by leveraging componentWillReceiveProps specifically looking for a new defaultValue.

This will help users who do not know what the defaultValue is on initialization but could possibly receive that data after the fact.

yhbrandon avatar Jan 21 '15 22:01 yhbrandon

Thanks @yhbrandon - I totally agree. The Input component has been overhauled and is now called TextField. It was added with this commit. https://github.com/callemall/material-ui/commit/b607a571b34801eef2360018125a200428cd40e2

We're still testing this out - hope to release this in a week or so.

hai-cea avatar Jan 22 '15 03:01 hai-cea

@hai-cea Thanks!

yhbrandon avatar Jan 22 '15 16:01 yhbrandon