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

picker组件滚动快到时点击确认数据不同步 #1160

Open
yehuozhili opened this issue Jan 12, 2024 · 1 comment
Open

picker组件滚动快到时点击确认数据不同步 #1160

yehuozhili opened this issue Jan 12, 2024 · 1 comment
Assignees
Labels
🐞 bug 漏洞

Comments

@yehuozhili
Copy link

Steps to Reproduce

直接用官网例子滚的快停时点确认就看见了,比如先在选项5上,转到快到1停止的时候按确认,toast提示选项5,第二次打开时默认值是选项1

Solution

我大概看了下,是因为wheel的滚动停止事件触发的比较晚onchange,这个时候先确认,wheel也没卸载,那么拿的就是滚动前的数据,然后滚动事件晚触发,下次点击打开就是最终想选的那个值。

有几种解决方法:
1、直接暴力解决,点确认的时候把当时的值拿到立即卸载wheel,不管他滚动事件结束没有。下次打开时再重新加载wheel。
2、在wheel处加个滚动状态,处于滚动状态中点确认需要等待滚动停止再确认。

Environment

  • zarm 3.0.17
@yehuozhili
Copy link
Author

或者把value值对上wheel的选中应该也可以,看了下zarm2好像没这问题

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

No branches or pull requests

3 participants