@material-ui/popper.js
Version:
A fork of popper.js to avoid the deprecation warnings: https://github.com/mui-org/material-ui/issues/19358.
15 lines (13 loc) • 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;
}