How to use the react-overlays/es/utils/isOverflowing function in react-overlays

To help you get started, we’ve selected a few react-overlays examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github signumsoftware / framework / Signum.React / Scripts / Components / Modal.tsx View on Github external
updateStyle() {

    const dialogNode = this._modal!.dialog;
    const dialogHeight = dialogNode.scrollHeight;

    const document = ownerDocument(dialogNode);
    const bodyIsOverflowing = isOverflowing(
      this.props.container && ReactDOM.findDOMNode(this.props.container) as HTMLElement || document.body
    );
    const modalIsOverflowing =
      dialogHeight > document.documentElement!.clientHeight;

    this.setState({
      style: {
        paddingRight:
          bodyIsOverflowing && !modalIsOverflowing
            ? getScrollbarSize()
            : undefined,
        paddingLeft:
          !bodyIsOverflowing && modalIsOverflowing
            ? getScrollbarSize()
            : undefined
      }