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,8 +74,12 @@ export default createComponent({
|
|||||||
if (offsetHeight) {
|
if (offsetHeight) {
|
||||||
const contentHeight = `${offsetHeight}px`;
|
const contentHeight = `${offsetHeight}px`;
|
||||||
wrapper.style.height = expanded ? 0 : contentHeight;
|
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;
|
raf(() => {
|
||||||
|
wrapper.style.height = expanded ? contentHeight : 0;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.onTransitionEnd();
|
this.onTransitionEnd();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user