reactjs-可以在输入字段上类型
我在输入字段上的打字问题。我正在从事一个大型项目,该项目已经有其他输入字段,该项目在我写它们时正在工作。今天,我正在添加新领域,并注意到这一点旧字段不接受任何类型的输入。
我知道这是一个常见的问题,但是我的问题既没有价值也没有变更集。
这是我正在研究的新领域的一个例子。
<TextField
id="outlined-basic"
name="text-container-field"
label="Texto"
variant="outlined"
value={this.state.customText}
onChange={this.onCustomTextChange.bind(this)}
/>
<input
type="text"
name="text-container"
value={this.state.customText}
onChange={this.onCustomTextChange.bind(this)}
/>
和Onchange功能
onCustomTextChange = event => {
this.setState({customText: event.target.value})
}
我写了带有MUI和本机输入的输入字段,只是为了检查MUI Textfield是否存在问题,但这都是相同的。
I'm having an issue with the typing on input fields.. i'm working on a big project, which already had other input fields, which were working at the time i wrote them.. today i was adding new fields and noticed that the old fields didn't accept any kind of input.
I know this a common question, but my problem is neither not having the value or the onChange set.
Here is a example of the new fields i was working on.
<TextField
id="outlined-basic"
name="text-container-field"
label="Texto"
variant="outlined"
value={this.state.customText}
onChange={this.onCustomTextChange.bind(this)}
/>
<input
type="text"
name="text-container"
value={this.state.customText}
onChange={this.onCustomTextChange.bind(this)}
/>
And the onChange function
onCustomTextChange = event => {
this.setState({customText: event.target.value})
}
i wrote the input fields with both MUI and native input just to check if there was an issue with MUI TextField, but it's all the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论