Fix wrapping overflow when up against the edge

Fixes #104508
This commit is contained in:
Daniel Imms
2020-08-12 16:18:37 -07:00
parent bf5bb7fc61
commit c80b8a3318
2 changed files with 6 additions and 1 deletions
@@ -141,7 +141,7 @@ export class HoverWidget extends Widget {
// Get horizontal alignment and position
let targetLeft = this._target.x !== undefined ? this._target.x : Math.min(...targetBounds.map(e => e.left));
if (targetLeft + this._hover.containerDomNode.clientWidth >= document.documentElement.clientWidth) {
this._x = document.documentElement.clientWidth;
this._x = document.documentElement.clientWidth - 1;
this._hover.containerDomNode.classList.add('right-aligned');
} else {
this._x = targetLeft;
@@ -18,6 +18,11 @@
color: #3794ff;
}
.monaco-workbench .workbench-hover.right-aligned {
/* The context view service wraps strangely when it's right up against the edge without this */
left: 1px;
}
.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions {
flex-direction: row-reverse;
}