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
Merged

Conversation

matpl
Copy link
Contributor

@matpl matpl commented Apr 15, 2019

No description provided.

matpl added 2 commits April 11, 2019 09:45
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.
@joaomoreno
Copy link
Member

@matpl What does this fix?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Apr 16, 2019
@matpl
Copy link
Contributor Author

matpl 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 assigned alexdima and unassigned joaomoreno Apr 16, 2019
@joaomoreno joaomoreno removed their request for review April 16, 2019 11:47
@joaomoreno joaomoreno removed the info-needed Issue requires more information from poster label Apr 16, 2019
@alexdima alexdima added this to the July 2019 milestone Jul 22, 2019
@alexdima alexdima merged commit b5bf231 into microsoft:master Jul 22, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants