I can't edit Text Field in Material-UI
Because you are controlling the value of TextField
by using value
attribute but you are not updating the value by using onChange
function, Since value of TextField
is not changing so it becomes read only.
Solution:
Specify the onChange
function with TextField
and update the value inside that, Like this:
<TextField
floatingLabelText={this.props.heading}
type={this.props.inputType}
value={this.props.value}
onChange={this.props._change}
/>
Inside parent component:
_Change(event, value){
//update the value here
}
<PanelDiv
heading='name'
inputType="text"
value={this.state.userData.name}
_change={this._change}
display={this.state.display[0]}
/>
Had the same error. I was not able to key in anything and it was because there was no name props included. example:
<TextField
type="email"
name='email'/>