Files
MoonPro.net/MP-MON/Scripts/src/utils/getRoot.js
T
Samuele E. Locatelli 4b8ed3219b Update popper packages
2020-01-31 16:44:33 +01:00

15 lines
309 B
JavaScript

/**
* Finds the root node (document, shadowDOM root) of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} node
* @returns {Element} root node
*/
export default function getRoot(node) {
if (node.parentNode !== null) {
return getRoot(node.parentNode);
}
return node;
}