Skip to content

Commit c80b8a3

Browse files
committed
Fix wrapping overflow when up against the edge
Fixes microsoft#104508
1 parent bf5bb7f commit c80b8a3

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class HoverWidget extends Widget {
141141
// Get horizontal alignment and position
142142
let targetLeft = this._target.x !== undefined ? this._target.x : Math.min(...targetBounds.map(e => e.left));
143143
if (targetLeft + this._hover.containerDomNode.clientWidth >= document.documentElement.clientWidth) {
144-
this._x = document.documentElement.clientWidth;
144+
this._x = document.documentElement.clientWidth - 1;
145145
this._hover.containerDomNode.classList.add('right-aligned');
146146
} else {
147147
this._x = targetLeft;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
color: #3794ff;
1919
}
2020

21+
.monaco-workbench .workbench-hover.right-aligned {
22+
/* The context view service wraps strangely when it's right up against the edge without this */
23+
left: 1px;
24+
}
25+
2126
.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions {
2227
flex-direction: row-reverse;
2328
}

0 commit comments

Comments
 (0)