Skip to content

Commit

Permalink
Use document when getRootNode is unsupported (chartjs#6641)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored and etimberg committed Nov 2, 2019
1 parent 38f6683 commit 4fbc7a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/platform.dom.js
Expand Up @@ -339,7 +339,7 @@ module.exports = {
// If the canvas is in a shadow DOM, then the styles must also be inserted
// into the same shadow DOM.
// https://github.com/chartjs/Chart.js/issues/5763
var root = canvas.getRootNode();
var root = canvas.getRootNode ? canvas.getRootNode() : document;
var targetNode = root.host ? root : document.head;
injectCSS(targetNode, stylesheet);
}
Expand Down

0 comments on commit 4fbc7a4

Please sign in to comment.