我有以下代码:
<Autocomplete
freeSolo={true}
options={this.state.data}
getOptionLabel={option => option.dataNumber}
renderInput={params =>
<TextField {...params}
ref={ this.searchInput }
name="search"
onKeyPress={(ev) => {
if (ev.key === 'Enter') {
this.handleSubmit(ev);
}
}}
onChange={ event => this.handleChange(event) }
InputLabelProps={{
shrink: false
}}
InputProps={{
disableUnderline: true
}}
placeholder={"Search"} />
}
/>
问题是我想禁用下划线,但这也禁用了 x 来清除输入。我尝试添加disableClearable={false}
但还是不行。
任何帮助或指导,将不胜感激!非常感谢。