美文网首页web前端
react下input聚焦

react下input聚焦

作者: 园Smile | 来源:发表于2020-05-25 13:44 被阅读0次
    <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

    相关文章

      网友评论

        本文标题:react下input聚焦

        本文链接:https://www.haomeiwen.com/subject/kolyahtx.html