microsoft / microsoft/monaco-editor

[Bug] HoverProvider does not work inside of Webcomponent (ShadowRoot)

Open
#3,409 36 comments 13 reactions 1 assignee View on GitHub

@aiday-mar is already working on this.

Since Mar 14, 2023.

blocked bug editor-hover editor-shadow-dom
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

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 Code

No response

Reproduction Steps

Host the Monacod Editor inside of a WebComponents ShadowRoot, then the hoverProvider does not work.

Actual (Problematic) Behavior

It is cause of this code:
image

It will raise the mouseLeave, cause the m.target is the dom node the component is hosted in.

Expected Behavior

hoverProvider should work

I think it should be solved using smth like

  m.composedPath()[0]  instead of m.target 

for the check

Additional Context

No response


Edit by @hediet:

Playground Example with WebComponents/Shadow Dom (broken)

Playground Example without Shadow Dom (works)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.