UNPKG

@fluentui/react-northstar

Version:
23 lines (21 loc) 680 B
"use strict"; exports.__esModule = true; exports.getBoundary = getBoundary; var _getScrollParent = require("./getScrollParent"); /** * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings. */ function getBoundary(element, boundary) { if (boundary === 'window') { return element.ownerDocument.documentElement; } if (boundary === 'scrollParent') { var boundariesNode = (0, _getScrollParent.getScrollParent)(element); if (boundariesNode.nodeName === 'BODY') { boundariesNode = element.ownerDocument.documentElement; } return boundariesNode; } return boundary; } //# sourceMappingURL=getBoundary.js.map