Skip to content

Commit

Permalink
Use document when getRootNode is unsupported (#6641)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored and etimberg committed Oct 29, 2019
1 parent f1d12dc commit 3b790ef
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 3b790ef

Please sign in to comment.