Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shadow root support for isInDOM function #72313

Merged
merged 2 commits into from Jul 22, 2019

Conversation

@matpl
Copy link
Contributor

commented Apr 15, 2019

No description provided.

matpl added some commits Apr 11, 2019

Add shadow root support for isInDOM
By getting the "host" property when "parentNode" is undefined, the function can properly climb the DOM tree and allow monaco-editor to be used within a shadow root.

@aeschli aeschli requested a review from joaomoreno Apr 15, 2019

@joaomoreno

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

@matpl What does this fix?

@matpl

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

I was trying to use Monaco Editor from within a web component with a shadow root, and the isInDOM check would fail and the editor wouldn't be rendered. It's because the parent of a shadow root node is found in the "host" property, and not "parentNode". This fix makes sure the isInDOM function can climb up the visual tree until it reaches the body node, even when there are shadow roots in the page.

@joaomoreno joaomoreno removed their request for review Apr 16, 2019

@alexandrudima alexandrudima added this to the July 2019 milestone Jul 22, 2019

@alexandrudima alexandrudima merged commit b5bf231 into microsoft:master Jul 22, 2019

5 checks passed

VS Code Build #20190415.2 succeeded
Details
VS Code (Linux) Linux succeeded
Details
VS Code (Windows) Windows succeeded
Details
VS Code (macOS) macOS succeeded
Details
license/cla All CLA requirements met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.