Skip to content

[Bug] Find widget tooltips appear above and so risk being cut off #5137

@AshleyScirra

Description

@AshleyScirra

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

n/a

Monaco Editor Playground Code

n/a

Reproduction Steps

We integrate the Monaco editor in to our software Construct. When hovering the mouse over the 'Find' widget buttons, the tooltip appears above the button, partially going outside the editor viewport. The way the Monaco editor is embedded in our app means the part of the tooltip going outside the editor viewport is cut off, like this:

Image

If the tooltip instead shows below the button, it looks OK:

Image

The Monaco playground has the tooltip appearing below the button. I can't figure out why the playground defaults to the tooltip showing below, and in our software the tooltip defaults to showing above. (In the Monaco playground the tooltip also uses a serif font that looks slightly out of place, so maybe something isn't set up correctly there.) I also can't figure out how to get the tooltip to layer above content outside of it - in some cases depending on how the CSS stacking contexts work out, it is probably impossible to do that. We have set up overflowWidgetsDomNode to allow things like autocomplete boxes to show outside the editor viewport, but it seems the tooltips do not count as overflow widgets and so don't use this, and so risk being cut off.

There is a simple solution: if Monaco defaults the Find widget tooltips to show below, then there is no risk they extend outside the viewport and get cut off. I can modify the Monaco source to make the default hoverPosition 2 for underneath, but this affects the entire editor and might cause other problems.

Therefore I would propose that Monaco either hard-codes those tooltips to show below, or add an option to IEditorFindOptions to specify the hover position.

Actual (Problematic) Behavior

Find widget tooltips risk being cut off.

Expected Behavior

Ability to show Find widget tooltips inside viewport.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions