【发布时间】:2016-03-27 01:28:42
【问题描述】:
我有一个 Autocomplete 字段,它使用:
searchText = {this.state.searchText}
这样;
<AutoComplete
floatingLabelText='agent input'
ref='agentInput'
hintText="type response"
multiLine = {true}
fullWidth = {true}
searchText = {this.state.searchText}
onNewRequest={this.sendAgentInput}
dataSource={this.agentCommands}
/>
但是当我更新this.setState({searchText: null })
它会清除自动完成一次,但不会第二次。
不确定这是错误还是有其他方法可以重置该字段。
我也尝试寻找该字段并添加ref,但没有运气。
在此处归档以防出现错误 https://github.com/callemall/material-ui/issues/2615
【问题讨论】:
-
你可以为此添加一个小提琴吗?
标签: reactjs material-ui