monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Add a setting like fixedOverflowWidgets for the context menu

Open spahnke opened this issue 7 years ago • 9 comments

monaco-editor version: 0.15.5 Browser: any OS: Windows 10

Edited: There was no bug in the first place, so this is rather a feature request.

Hi,

we embed the editor in a div which has overflow: hidden set which I can't change easily (it's a custom element coming from our framework). If you set fixedOverflowWidgets: true widgets like the suggestion list are able to overflow the editor space such that they are shown to their full extent. However, this does not affect the context menu. It would be great to have a similar option for it.

Playground example: Open a context menu at the border of the marked div.

monaco.editor.create(document.getElementById("container"), {
    value: "function hello() {\n\talert('Hello world!');\n}",
    language: "javascript",
    fixedOverflowWidgets: true
});
<div style="height: 300px; overflow: hidden; border: 1px solid red;">
    <div id="container" style="height:100%;"></div>
</div>

Thanks!

spahnke avatar Nov 19 '18 10:11 spahnke

@spahnke Not sure I fully understand the problem. Here is what I get (which looks kind of OK):

image

alexdima avatar Nov 20 '18 15:11 alexdima

Ah, that looks right, but it is broken for the context menu. I will edit the issue text. grafik

spahnke avatar Nov 20 '18 15:11 spahnke

Might be related to #1199. But @spahnke AFAIK the flag fixedOverflowWidgets was never influencing the context menu (in any editor version).

alexdima avatar Nov 20 '18 15:11 alexdima

You are right, the flag didn't affect the context menu at all. I don't where I was looking... Is there anything else I could do about that?

I'm so sorry for the noise! 😥

spahnke avatar Nov 20 '18 18:11 spahnke

Hm... we probabaly need an option in the editor in order not to let the context menu overflow the editor space.

joaomoreno avatar Nov 22 '18 10:11 joaomoreno

That would be ideal.

spahnke avatar Nov 22 '18 15:11 spahnke

@alexdima was there any progress on this issue?

izikl avatar Jul 20 '21 22:07 izikl

@alexdima Just pinging to see if this backlog item could be addressed some time in the near future.

Weffe avatar May 19 '22 21:05 Weffe

ping on this

lidermanrony avatar Jul 11 '22 21:07 lidermanrony

pined

jardenliu avatar Aug 22 '23 02:08 jardenliu