monaco-editor npm version: 0.7.0
Browser: Chrome
OS: OSX
How Can I keep suggestions inside editor? Suggestions should respect boundaries of the layout - not entire browser.

In this context I would like to see suggestions right corner to be aligned to the editor right corner.
Is it possible in current version as a flag or is there any way to manually fix suggestions window position?
I have tried:
fixedOverflowWidgets: true but it's not working or it's intended to do something different - not sure.
I have tried:
for (const prop in this.editor.contentWidgets) {
const contentWidget = this.editor.contentWidgets[prop];
contentWidget.widget.allowEditorOverflow = false;
}
but it is used in addWidget so it's already to late:
if (widgetData.allowEditorOverflow) {
this.overflowingContentWidgetsDomNode.appendChild(domNode);
} else {
this.domNode.appendChild(domNode);
}
Additionally it seems inconsistent.
widgets default to true:
// Editor.IContentWidget.allowEditorOverflow
allowEditorOverflow = true;
while addWidget defaults to false:
allowEditorOverflow: widget.allowEditorOverflow || false,
Each content widget can set allowEditorOverflow as it desires. The suggest widgets sets it to true.
We do not currently have an editor option to override/ignore that.
So let's treat it as feature request then.
Any updates?
Having the same problem...
Is there any workaround?
I used internals to move them to the dom root - but didn't update Monaco for some time already because of it
Each content widget can set
allowEditorOverflowas it desires. The suggest widgets sets it totrue.We do not currently have an editor option to override/ignore that.
I can try to add a PR for this in vscode. Can you confirm that this is how you want it to work?
Have a flag on the editor called keepWidgetsWithEditor with 2 values:
* true - all widgets will be forced to be drawn with the editor viewport. We do this by updating only vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts
* false - the default value, representing the current behavior
In my case problem was mostly because of z-index - suggestions were partly hidden under other UI elements.
<body> to avoid all z-index issues by being last thing in DOM.For (2) it could be optional field like:
idOfElementToPlaceModals: "domElementId"
Any Update ?
Most helpful comment
Any updates?