Fixes #69391: Reserve extra bottom padding when the hover has a horizontal scrollbar

This commit is contained in:
Alex Dima
2022-01-27 13:58:01 +01:00
parent 1c2f442e02
commit be5b4fc06b
3 changed files with 23 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ export class HoverWidget extends Disposable {
public readonly containerDomNode: HTMLElement;
public readonly contentsDomNode: HTMLElement;
private readonly _scrollbar: DomScrollableElement;
public readonly scrollbar: DomScrollableElement;
constructor() {
super();
@@ -31,14 +31,14 @@ export class HoverWidget extends Disposable {
this.contentsDomNode = document.createElement('div');
this.contentsDomNode.className = 'monaco-hover-content';
this._scrollbar = this._register(new DomScrollableElement(this.contentsDomNode, {
this.scrollbar = this._register(new DomScrollableElement(this.contentsDomNode, {
consumeMouseWheelIfScrollbarIsNeeded: true
}));
this.containerDomNode.appendChild(this._scrollbar.getDomNode());
this.containerDomNode.appendChild(this.scrollbar.getDomNode());
}
public onContentsChanged(): void {
this._scrollbar.scanDomNode();
this.scrollbar.scanDomNode();
}
}