-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
fix(Picker): ensure that the confirm event params are up to date #13381
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
Conversation
… nextTick location when you click confirm
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13381 +/- ##
==========================================
+ Coverage 89.60% 89.75% +0.15%
==========================================
Files 257 257
Lines 7013 7021 +8
Branches 1736 1738 +2
==========================================
+ Hits 6284 6302 +18
+ Misses 384 380 -4
+ Partials 345 339 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Could you please add a test for the case? Thanks. |
hello,你可以看下我的 github 仓库 https://github.com/front-refined/vant-picker-issue 描述、视频和运行起来调试,这个 bug 存在偶发性,感谢 |
你好,我对于这个 bug 的修复没有疑义,只是为了避免之后该 bug 的回归,我们最好有一个对应的单元测试。 |
你好,感谢答复,我尝试补充了单元测试,你看 ok 吗 |
@inottn 你好,帮忙 review 下 |
这里的confirm的返回值与事件confirm输出的值不一致 |
你好,单测需要其能验证该 PR 的改动:即在改动前运行应失败,改动后应通过。 |
是的,但是修复 confirm 方法的返回值很困难,这需要返回一个 Promise。我们可以先修复事件输出的值。 |
感谢指点,我这里已经修改了测试用例,并且按照你说的自测通过。麻烦帮忙再看看 @inottn |
是的,我有考虑过这个问题,但是如果修改了,对于开发者会有 Breaking changes,因为只能是 Promise 的方式了。 对于这个方法,我有几点想法:
|
Co-authored-by: inottn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
如注释描述,需要在 nextTick 后去获取最新的值,所以要放在 nextTick 的回调里获取最新。
这块需要手动测试,在配置了 min-date 后,滚动还没有停止时,就快速直接点击 confirm 按钮的场景。
#11878