mirror of
https://github.com/youzan/vant.git
synced 2025-12-22 01:07:29 +08:00
[bugfix] Collapse: use double raf to ensure animation can start (#3723)
This commit is contained in:
@@ -74,8 +74,12 @@ export default createComponent({
|
||||
if (offsetHeight) {
|
||||
const contentHeight = `${offsetHeight}px`;
|
||||
wrapper.style.height = expanded ? 0 : contentHeight;
|
||||
|
||||
// use double raf to ensure animation can start in mobile safari
|
||||
raf(() => {
|
||||
wrapper.style.height = expanded ? contentHeight : 0;
|
||||
raf(() => {
|
||||
wrapper.style.height = expanded ? contentHeight : 0;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.onTransitionEnd();
|
||||
|
||||
Reference in New Issue
Block a user