Skip to content

Commit

Permalink
Force custom editors in diff view to have 100% height wrappers (#96969)
Browse files Browse the repository at this point in the history
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 ea07e9b, 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
  • Loading branch information
mjbvz authored May 5, 2020
1 parent c3b0ae5 commit d69a79b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

3 comments on commit d69a79b

@mahmou7d
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@mahmou7d
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@mahmou7d
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.