monaco-editor
monaco-editor copied to clipboard
[Bug] Suggestion box has the wrong height when the available space is limited
Reproducible in vscode.dev or in VS Code Desktop?
- [X] Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- [ ] Not reproducible in the monaco editor playground
Monaco Editor Playground Code
The code doesn't matter, the window size does.
I made a 1 minute Loom video about reproducing the bug several times in the Monaco Editor Playground:
https://www.loom.com/share/44c73f0233004e508c3d35a62da429d8
Actual Behavior
The suggestion box becomes very little—in many cases just one line high!
Expected Behavior
The suggestion box should reasonably fill the available space.
Additional Context
In VS Code, the bug is technically there (here is a 2-min video about it), but its impact is way smaller: it's a very narrow edge case and not likely to ever cause real trouble for users, so I don't think it'd ever get attention from the VS Code team. But for other uses of this open-source component, it's a real bug (as I demoed it in the playground), so I think this bug report belongs in this project.
Why this hurts me: I'm a developer at Sourcegraph, and I'm building a plugin for JetBrains product where I use the Monaco Editor for our search box. The space there is pretty limited, so the suggestion box often becomes just a single line.
Hmm, at least when I used the monaco-editor in a side-project, it worked:

I don't remember the configuration anymore though.
@hediet: It works totally fine if there's that much space below the editor. The bug appears when there is not so much space underneath it. (See the details, plus a video demo, in my original description.)
+1 on this issue. Because monaco editor doesn't allow multiple themes in a single window, I need to wrap every editor in an iframe. Because the iframe encapsulates the editor in a tight window object, and the suggestions can't overflow, they become very small very easily. My only solution is to have an editor waaay bigger than needed (sometime 3 lines is enough, but with a window 3 lines high, the suggestions won't even appear)
Also, If the window is small and I have only 3 lines, (but could fit 6 in the space) I get only 1 suggestion. If I add a few line breaks to get 6 empty lines in the editor, I get 3 suggestions

+1 — we also desire to integrate Monaco using an Iframe and encountered the same issue. At first glance I'm thinking it would be nice to be able to provide an explicit parent element for the suggestion menu.
+1 Is there an update? I still have this issue. Did you manage to find a workaround?
closing as duplicate of https://github.com/microsoft/vscode/issues/152324