Skip to content

Commit 26b983f

Browse files
authored
fixes #216805 (#282225)
1 parent 5e8c53b commit 26b983f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/vs/workbench/contrib/files/browser/views/explorerViewer.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -890,13 +890,16 @@ export class FilesRenderer implements ICompressibleTreeRenderer<ExplorerItem, Fu
890890
const templateDisposables = new DisposableStore();
891891
const label = templateDisposables.add(this.labels.create(container, { supportHighlights: true }));
892892
templateDisposables.add(label.onDidRender(() => {
893-
try {
894-
if (templateData.currentContext) {
895-
this.updateWidth(templateData.currentContext);
893+
// schedule this on the next animation frame to avoid rendering reentry
894+
DOM.scheduleAtNextAnimationFrame(DOM.getWindow(templateData.container), () => {
895+
try {
896+
if (templateData.currentContext) {
897+
this.updateWidth(templateData.currentContext);
898+
}
899+
} catch (e) {
900+
// noop since the element might no longer be in the tree, no update of width necessary
896901
}
897-
} catch (e) {
898-
// noop since the element might no longer be in the tree, no update of width necessary
899-
}
902+
});
900903
}));
901904

902905
const contribs = explorerFileContribRegistry.create(this.instantiationService, container, templateDisposables);

0 commit comments

Comments
 (0)