Skip to content

Commit bdf8dd0

Browse files
authored
Use the proper scrollbar, fixes microsoft#166171 (microsoft#166302)
1 parent f952317 commit bdf8dd0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/vs/workbench/services/hover/browser/hoverWidget.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,16 @@ export class HoverWidget extends Widget {
455455
maxHeight = Math.min(maxHeight, this._hover.containerDomNode.clientHeight);
456456

457457
this._hover.containerDomNode.style.maxHeight = `${maxHeight}px`;
458+
if (this._hover.contentsDomNode.clientHeight > maxHeight) {
459+
this._hover.contentsDomNode.style.height = `${maxHeight}px`;
460+
}
461+
if (this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) {
462+
// Add padding for a vertical scrollbar
463+
const extraRightPadding = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
464+
if (this._hover.contentsDomNode.style.paddingRight !== extraRightPadding) {
465+
this._hover.contentsDomNode.style.paddingRight = extraRightPadding;
466+
}
467+
}
458468
}
459469

460470
private setHoverPointerPosition(target: TargetRect): void {

src/vs/workbench/services/hover/browser/media/hover.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/* Must be higher than sash's z-index and terminal canvases */
1111
z-index: 40;
1212
overflow: hidden;
13-
overflow-y: auto;
1413
max-width: 700px;
1514
}
1615

0 commit comments

Comments
 (0)