未验证 提交 9c653ada 编写于 作者: M Matt Bierner 提交者: GitHub

Avoid accessing style in treeview if we don't need to (#64577)

Fixes #64576

We compute the style of an element to access its left padding. However this value is only used when `horizontalScrolling` is enabled.

With this change,  we only compute the style when `horizontalScrolling` is true
上级 35f96ebe
......@@ -260,8 +260,11 @@ export class ViewItem implements IViewItem {
}
if (!skipUserRender && this.element) {
const style = window.getComputedStyle(this.element);
const paddingLeft = parseFloat(style.paddingLeft);
let paddingLeft: number | undefined;
if (this.context.horizontalScrolling) {
const style = window.getComputedStyle(this.element);
paddingLeft = parseFloat(style.paddingLeft);
}
if (this.context.horizontalScrolling) {
this.element.style.width = 'fit-content';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册