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
This commit is contained in:
Matt Bierner
2020-04-30 12:24:38 -07:00
parent c7abcf4639
commit ea07e9bbdc
@@ -102,8 +102,8 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewOv
this.container.style.position = 'absolute';
this.container.style.top = `${frameRect.top - containerRect.top}px`;
this.container.style.left = `${frameRect.left - containerRect.left}px`;
this.container.style.width = `${dimension ? dimension.width : frameRect.width}px`;
this.container.style.height = `${dimension ? dimension.height : frameRect.height}px`;
this.container.style.width = `${dimension && frameRect.width > 0 ? dimension.width : frameRect.width}px`;
this.container.style.height = `${dimension && frameRect.height > 0 ? dimension.height : frameRect.height}px`;
}
private show() {