All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.node_modules.popper.js.src.utils.getRoot.js Maven / Gradle / Ivy

The newest version!
/**
 * 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;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy