antd inputnumber:执行函数onchangecomplete而不是onchange
<Form.Item
label="Amount"
name={[index, 'amount']}
>
<InputNumber
style={{ width: '100%' }}
min={1}
// onChange={() => {
// const array = [...form.getFieldValue('bankAccount')]
// setCurrentAccountArray(array)
// }}
/>
</Form.Item>
在上面的代码中,您可以看到我正在强行更新CurrentAccountarray的状态, 我想在值完全更改而不是onchange之后执行此操作,该值在每个密钥按下都执行...
有什么方法可以实现这一目标吗?我不想使用Onenterpressed。
<Form.Item
label="Amount"
name={[index, 'amount']}
>
<InputNumber
style={{ width: '100%' }}
min={1}
// onChange={() => {
// const array = [...form.getFieldValue('bankAccount')]
// setCurrentAccountArray(array)
// }}
/>
</Form.Item>
in the code above you can see that I am forcefully updating the state of currentAccountArray,
I want to execute this after the value is completely changed instead of onChange, which executes on every key press...
is there a way I can achieve this? I do not want to use onEnterPressed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许使用输入而不是onchange?
- 或者 -
也许封闭的延迟电话?
Maybe use onInput instead of onChange?
-- OR --
Maybe a delayed call wrapped in a closure?