Skip to content

滚动条事件有微小延迟问题 #30

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

Open
kentLin0 opened this issue Oct 26, 2022 · 3 comments
Open

滚动条事件有微小延迟问题 #30

kentLin0 opened this issue Oct 26, 2022 · 3 comments

Comments

@kentLin0
Copy link

场景:用在表格body内滚动条设置,绑定了滚动事件来实时滚动header位置。
现象:表格body和header会有0.2s左右的延迟差异,不是很明显,但是注意看能看出来

分析:有没有可能是滚动动画和实际位置计算有位差导致的?

@javaLuo
Copy link
Owner

javaLuo commented Oct 27, 2022

我检查一下

@kentLin0
Copy link
Author

这个场景是拖动左右的滚动条才会出现,看了一下源码发现是这个动画导致的,cancelAnimationFrame,把437行的左右过渡动画移除就没延迟了

@kentLin0
Copy link
Author

这里的拖动动画说实话交互体验的提升有限,个人感觉可以去掉拖拽时候的动画

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

2 participants