antd is triggered when the keyboard is pressed, which is different from the traditional change event. I don"t know what happened.
is written according to the official document, and the code is as follows:
handleInputChange = (e) => {
console.log("111111111");
}
render() {
return (
<Form layout="horizontal" style={{ width: 300 }}>
<FormItem>
{
getFieldDecorator("userName", {
initialValue: "Jack",
rules: [
{validator:this.checkUname}
]
})(
<Input prefix={<Icon type="user"/>} placeholder="" onChange={this.handleInputChange}/>
)
}
</FormItem>
</Form>
);
}
question: every time I press the keyboard, the console will output "111111111". Why not output it when the cursor leaves the input? How do I fix the code?