react下input聚焦
2020-05-25 本文已影响0人
园Smile
<Input
style={{ width: '300px' }}
className={hideShow ? styles.inpHide : styles.inpShow}
value={valueIpt}
ref={input => (this.textInput = input)}
onChange={this.onChangeIpt}
onBlur={this.changeNameSave}
onFocus={this.handleFocus}
/>
handleDBClick = () => {
this.setState({
hideShow: false,
valueIpt: this.state.valueSel
}, () => {
this.textInput.focus()
})
}
image.png
image.png