mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[bugfix] Collapse: can not expand when clientHeight equals zero (#2993)
This commit is contained in:
@@ -80,11 +80,16 @@ export default sfc({
|
||||
return;
|
||||
}
|
||||
|
||||
const contentHeight = `${content.clientHeight}px`;
|
||||
wrapper.style.height = expanded ? 0 : contentHeight;
|
||||
raf(() => {
|
||||
wrapper.style.height = expanded ? contentHeight : 0;
|
||||
});
|
||||
const { clientHeight } = content;
|
||||
if (clientHeight) {
|
||||
const contentHeight = `${clientHeight}px`;
|
||||
wrapper.style.height = expanded ? 0 : contentHeight;
|
||||
raf(() => {
|
||||
wrapper.style.height = expanded ? contentHeight : 0;
|
||||
});
|
||||
} else {
|
||||
this.onTransitionEnd();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user