Skip to content

Commit 65421bb

Browse files
kurkleetimberg
authored andcommitted
Use document when getRootNode is unsupported (#6641)
1 parent a92dd7b commit 65421bb

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)