Monaco-editor: UI breaks inside ShadowDom

Created on 5 May 2020  路  4Comments  路  Source: microsoft/monaco-editor

monaco-editor version: 0.20.0
Browser:Chrome
OS:Mac OS
When i to include monaco-editor inside a shadow DOM , most of the UI is breaking.
I have include the Demo for this issue in https://github.com/Pranomvignesh/MonacoEditorInsideShadowDom

Line Numbers , Find & Replace and Mini map UI are getting broken

MonacoShadowDomIssue

Most helpful comment

@GitHubJasper , I am using monaco editor inside shadowDom for about a week and i haven't found any issues. I posted it just to clarify if anyone has encountered any problem in this approach. Will post an issue if i find problem and Thanks for your response

All 4 comments

I was also having issues, but could solve them by linking the editor.main.css style sheet in the shadow DOM as was suggested here: #1843

If that doesn't solve it maybe try looking at this test file: https://github.com/microsoft/monaco-editor/blob/daabff0021fd6d4f5b57479b99b9a8ab900f951a/test/shadow-dom.html#L27-L43

@GitHubJasper Thanks for your response. It works.
But now I am more concerned with the events registered by the monaco editor.
Is there any events registered globally by monaco editor. If so then i think it may not work properly inside the shadowRoot(Correct me if i am wrong)

I am not an expert on this topic myself but I don't think there are any, so far I haven't seen anything break in the shadowdom (except for the styling issues).

I would suggest just trying it out
If something doesn't seem to work, then also try it outside the shadowdom and maybe make a new issue for the specific problem you found.
Though, like I said, I haven't found any other problems yet.

@GitHubJasper , I am using monaco editor inside shadowDom for about a week and i haven't found any issues. I posted it just to clarify if anyone has encountered any problem in this approach. Will post an issue if i find problem and Thanks for your response

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chengtie picture chengtie  路  3Comments

andreymarchenko picture andreymarchenko  路  3Comments

Spongman picture Spongman  路  3Comments

inf9144 picture inf9144  路  3Comments

galusben picture galusben  路  3Comments