Always use clientHeight

The other height value includes decimal values, which I don't think we want
上级 44a786ed
......@@ -248,21 +248,16 @@ async function webviewPreloads(style: PreloadStyles, options: PreloadOptions, re
if (entry.target.id === observedElementInfo.id && entry.contentRect) {
if (observedElementInfo.output) {
let height = 0;
if (entry.contentRect.height !== 0) {
entry.target.style.padding = `${style.outputNodePadding}px ${style.outputNodePadding}px ${style.outputNodePadding}px ${style.outputNodeLeftPadding}px`;
height = entry.contentRect.height + style.outputNodePadding * 2;
} else {
entry.target.style.padding = `0px`;
}
dimensionUpdater.update(observedElementInfo.id, height, {
isOutput: true
});
} else {
dimensionUpdater.update(observedElementInfo.id, entry.target.clientHeight, {
isOutput: false
});
}
dimensionUpdater.update(observedElementInfo.id, entry.target.clientHeight, {
isOutput: observedElementInfo.output
});
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册