From d69a79b73808559a91206d73d7717ff5f798f23c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 May 2020 14:48:19 -0700 Subject: [PATCH] Force custom editors in diff view to have 100% height wrappers (#96969) Fix for #96968 This is a scoped fix for #96968. The cause of the issue is the following: 1. Webview must be rendered outside of the main editor DOM. We do this by absolutely positioning them over some element in the DOM. 1. In split views, we try to lay the webview out over an element that has 0 height. 1. Due to my workaround in ea07e9bbdc598480dadfd1297e9e817e40802bce, this causes the webview to either not show at all (because it also will have zero height) or partially show This fix forces the webivew's parent in the split view to have 100%. That actually seems like a reasonable default but I've scoped my fix to just webviews --- .../contrib/webview/browser/dynamicWebviewEditorOverlay.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts b/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts index c8396d281d749..27d56ce2dc55f 100644 --- a/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts +++ b/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts @@ -97,6 +97,12 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewOv if (!this.container || !this.container.parentElement) { return; } + + // Workaround for #94805 + if ((element.classList.contains('details-editor-container') || element.classList.contains('master-editor-container')) && !element.style.height) { + element.style.height = '100%'; + } + const frameRect = element.getBoundingClientRect(); const containerRect = this.container.parentElement.getBoundingClientRect(); this.container.style.position = 'absolute';