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

[Bug] Suggestion box has the wrong height when the available space is limited

Open vdavid opened this issue 3 years ago • 4 comments

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?

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.

vdavid avatar Jun 16 '22 12:06 vdavid

Hmm, at least when I used the monaco-editor in a side-project, it worked:

image

I don't remember the configuration anymore though.

hediet avatar Jul 19 '22 14:07 hediet

@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.)

vdavid avatar Jul 19 '22 20:07 vdavid

+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)

janarvaez avatar Aug 10 '22 09:08 janarvaez

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

Screenshot 2022-08-10 at 12 15 30 Screenshot 2022-08-10 at 12 15 58

janarvaez avatar Aug 10 '22 10:08 janarvaez

+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.

klebba avatar Sep 29 '22 18:09 klebba

+1 Is there an update? I still have this issue. Did you manage to find a workaround?

FlorianPoessl avatar Nov 02 '23 09:11 FlorianPoessl

closing as duplicate of https://github.com/microsoft/vscode/issues/152324

jrieken avatar Dec 06 '23 11:12 jrieken