@fluentui/react-northstar
Version:
A themable React component library.
19 lines (18 loc) • 588 B
JavaScript
import { getScrollParent } from './getScrollParent';
/**
* Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.
*/
export function getBoundary(element, boundary) {
if (boundary === 'window') {
return element.ownerDocument.documentElement;
}
if (boundary === 'scrollParent') {
var boundariesNode = getScrollParent(element);
if (boundariesNode.nodeName === 'BODY') {
boundariesNode = element.ownerDocument.documentElement;
}
return boundariesNode;
}
return boundary;
}
//# sourceMappingURL=getBoundary.js.map