Skip to content

Commit 09bd524

Browse files
kurkleetimberg
authored andcommitted
Use document when getRootNode is unsupported (#6630)
1 parent 994fe71 commit 09bd524

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/platforms/platform.dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ module.exports = {
339339
// If the canvas is in a shadow DOM, then the styles must also be inserted
340340
// into the same shadow DOM.
341341
// https://github.com/chartjs/Chart.js/issues/5763
342-
var root = canvas.getRootNode();
342+
var root = canvas.getRootNode ? canvas.getRootNode() : document;
343343
var targetNode = root.host ? root : document.head;
344344
injectCSS(targetNode, stylesheet);
345345
}

0 commit comments

Comments
 (0)