diff options
author | Matt Bierner <matb@microsoft.com> | 2020-05-06 00:48:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 00:48:19 +0300 |
commit | d69a79b73808559a91206d73d7717ff5f798f23c (patch) | |
tree | 8f9cc08b95989e88db6badddd67d4321ff3263d4 | |
parent | c3b0ae556040a83ed8e11a1527248b727facb656 (diff) |
Force custom editors in diff view to have 100% height wrappers (#96969)1.45.0
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
-rw-r--r-- | src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts b/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts index c8396d281d7..27d56ce2dc5 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'; |