react input 获取/失去焦点
<div className={ this.state.focus ? "dis_bottom_left_onfocus" : "dis_bottom_left" } ref="bottom_left">
<input
type="text"
className="dis_bottom_input"
ref="bottom_input"
placeholder={this.props.mainName || "说点什么吧"}
onBlur={ ::this.inputOnBlur }
onFocus={ ::this.inputOnFocus } />
</div>
//input 获取焦点 width: 100%
inputOnFocus(){
this.setState({ focus: true });
}
//input 失去焦点
inputOnBlur(){
this.setState({ focus: false });
}
以上是 react input 获取/失去焦点 的全部内容, 来源链接: utcz.com/z/382898.html