Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【询问】onBlur() 怎么获取最新的 value? #325

Closed
sanheng opened this issue May 11, 2021 · 0 comments
Closed

【询问】onBlur() 怎么获取最新的 value? #325

sanheng opened this issue May 11, 2021 · 0 comments

Comments

@sanheng
Copy link

sanheng commented May 11, 2021

在 onBlur 获取最新值去请求后端来校验数据,但是当输入数字超过 max min 的时候会触发 onChange 修正 value,这时候 onBlur 就获取不到最新的 value。

目前我是用 ref 来做的:
https://codesandbox.io/s/cocky-pond-fo19n?file=/src/App.js

想问下有没有更好的方式来处理这种情况。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant