mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
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.
This commit is contained in:
@@ -32,7 +32,7 @@ export function isInDOM(node: Node | null): boolean {
|
||||
if (node === document.body) {
|
||||
return true;
|
||||
}
|
||||
node = node.parentNode;
|
||||
node = node.parentNode || node.host;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user