We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eba622a commit 46babbdCopy full SHA for 46babbd
src/cdk/platform/features/shadow-dom.ts
@@ -23,7 +23,9 @@ export function _getShadowRoot(element: HTMLElement): Node | null {
23
if (_supportsShadowDom()) {
24
const rootNode = element.getRootNode ? element.getRootNode() : null;
25
26
- if (rootNode instanceof ShadowRoot) {
+ // Note that this should be caught by `_supportsShadowDom`, but some
27
+ // teams have been able to hit this code path on unsupported browsers.
28
+ if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {
29
return rootNode;
30
}
31
0 commit comments