Skip to content

[Bug] createDecorationsCollection.className doesn't work with selection when using backgroundColor #3929

@dlitsman

Description

@dlitsman

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

https://microsoft.github.io/monaco-editor/playground.html?source=v0.37.1#example-interacting-with-the-editor-rendering-glyphs-in-the-margin

It seems there is no way to make selection work together with createDecorationsCollection.className which sets backgroundColor. When I select a text over decorated line I don't see selection range.

Screen.Recording.2023-04-24.at.00.10.30.mov

However, I can still see similar words are selected

image

Monaco Editor Playground Code

Default one from the link above

Reproduction Steps

  1. Select a part of text on line 3
  2. Make a change to it

Actual (Problematic) Behavior

It is not possible to tell what is the current selection

Expected Behavior

I can always see which part of the line is selected

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions