Debian Codegraph @

packages/popper/src/utils/getParentNode.js

raw
1 /**
2 * Returns the parentNode or the host of the element
3 * @method
4 * @memberof Popper.Utils
5 * @argument {Element} element
6 * @returns {Element} parent
7 */
8 export default function getParentNode(element) {
9 if (element.nodeName === 'HTML') {
10 return element;
11 }
12 return element.parentNode || element.host;
13 }