Skip to content

Commit

Permalink
fix(style injection): change style injection default root
Browse files Browse the repository at this point in the history
Change style injection root to evaluated parent node, that should equal to nearest shadow root host,
otherwise use head

fix #665
  • Loading branch information
smielowskij authored and roggervalf committed Jan 14, 2021
1 parent 401ef82 commit a00c5b7
Show file tree
Hide file tree
Showing 2 changed files with 765 additions and 474 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class ReactTooltip extends React.Component {
parentNode = parentNode.parentNode;
}
const head = parentNode.querySelector('head');
domRoots.push(head || parentNode);
domRoots.push(parentNode || head);
});
if (domRoots.length) {
const style = document.createElement('style');
Expand Down
Loading

0 comments on commit a00c5b7

Please sign in to comment.