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

fix(Collapse): animate invalid on multi clicks #4567

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

nemo-shen
Copy link
Collaborator

无反应
#4422
#4068

缓慢
#4523
#4111

问题描述

此类问题应该只在使用 小程序基础库 v2.9.0 以上的小程序上出现

原因分析

应该是微信新提供的 this.animate 和旧版的 wx.createAnimation 存在差异。
主要差异应该是 this.animate 内部应该是队列形式,必须要执行完上一个动画才可以,而 wx.createAnimation 实际是生成动画样式,然后塞到dom中,可以进行强行中断当前动画塞入新动画。

其他尝试

  • 尝试在使用 this.animate 时判断当前是否正在进行动画,如果有则调用 this.clearAnimation。但是效果并不理想,会有闪烁出现

猜测的结论

所以像这种快速点击(多次中断当前动画)的场景 this.animate 可能无法满足

@chenjiahan chenjiahan merged commit 1860ddf into youzan:dev Oct 18, 2021
@nemo-shen nemo-shen deleted the bugfix/collapse_1012 branch October 19, 2021 16:41
@lxc1997222
Copy link

lxc1997222 commented Oct 20, 2021

大佬,这个快速点击折叠面板时内容消失的问题有解决的可能性吗QAQ,我更新了一下依赖,问题还是存在滴 @shiny @chuangbo @winglechen @brookqin

@chenjiahan
Copy link
Member

这个版本还没发布呢,可以等发布了再试试

@lxc1997222
Copy link

好的谢谢大佬!!

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

Successfully merging this pull request may close these issues.

3 participants