mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-04 23:44:05 +01:00
Use document when getRootNode is unsupported (#6630)
This commit is contained in:
committed by
Evert Timberg
parent
994fe712de
commit
09bd524dd3
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user