aboutsummaryrefslogtreecommitdiffstats
path: root/npm_assets/node_modules/popper.js/src/utils/getParentNode.js
blob: d90f706d78a66a7edd0ecd0b92d3693256c1c4c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * Returns the parentNode or the host of the element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} parent
 */
export default function getParentNode(element) {
  if (element.nodeName === 'HTML') {
    return element;
  }
  return element.parentNode || element.host;
}