Skip to content

Commit ea07e9b

Browse files
committed
Don't give webview a width if its container has none
Fixes #94805 When the panel is maximized over a webview, on reload VS Code calls `.layout` with the dimensions of the editor. However in this case, the dimensions do not match what is actually visible In this case, the parent element should have zero width so we should make sure that we do not try giving the webview a width too
1 parent c7abcf4 commit ea07e9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewOv
102102
this.container.style.position = 'absolute';
103103
this.container.style.top = `${frameRect.top - containerRect.top}px`;
104104
this.container.style.left = `${frameRect.left - containerRect.left}px`;
105-
this.container.style.width = `${dimension ? dimension.width : frameRect.width}px`;
106-
this.container.style.height = `${dimension ? dimension.height : frameRect.height}px`;
105+
this.container.style.width = `${dimension && frameRect.width > 0 ? dimension.width : frameRect.width}px`;
106+
this.container.style.height = `${dimension && frameRect.height > 0 ? dimension.height : frameRect.height}px`;
107107
}
108108

109109
private show() {

0 commit comments

Comments
 (0)