mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
[bugfix] Collapse: use double raf to ensure animation can start (#3723)
This commit is contained in:
parent
5b4a4cc078
commit
e7e015e9a4
@ -74,9 +74,13 @@ 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(() => {
|
||||
raf(() => {
|
||||
wrapper.style.height = expanded ? contentHeight : 0;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.onTransitionEnd();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user