How to use the dom-helpers/util/scrollbarSize function in dom-helpers

To help you get started, we’ve selected a few dom-helpers 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 fanruan / intelli-swift-core / fbi_h5 / src / com / fr / bi / h5 / src / base / Grid / Grid.js View on Github external
componentWillMount () {
    // If this component is being rendered server-side, getScrollbarSize() will return undefined.
    // We handle this case in componentDidMount()
    this._scrollbarSize = getScrollbarSize()
    if (this._scrollbarSize === undefined) {
      this._scrollbarSizeMeasured = false
      this._scrollbarSize = 0
    } else {
      this._scrollbarSizeMeasured = true
    }

    this._calculateChildrenToRender()
  }
github istarkov / revue / src / prism / FileHeaders.js View on Github external
({ offset, rowHeight }) => ({
      posStyle: {
        top: offset,
        height: rowHeight,
        paddingRight: scrollbarSize(), // memoized in lib
      },
    })
  ),
github react-bootstrap / react-bootstrap / src / Modal.js View on Github external
const dialogNode = this._modal.getDialogElement();
    const dialogHeight = dialogNode.scrollHeight;

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

    this.setState({
      style: {
        paddingRight:
          bodyIsOverflowing && !modalIsOverflowing
            ? getScrollbarSize()
            : undefined,
        paddingLeft:
          !bodyIsOverflowing && modalIsOverflowing
            ? getScrollbarSize()
            : undefined
      }
    });
  }
github jquense / react-bootstrap-modal / src / Modal.js View on Github external
_getStyles() {
    if (!canUseDOM)
      return {}

    let node = findDOMNode(this.dialog)
      , doc = ownerDocument(node)
      , scrollHt = node.scrollHeight
      , bodyIsOverflowing = isOverflowing(this.props.container || doc.body)
      , modalIsOverflowing = scrollHt > doc.documentElement.clientHeight

    return {
      dialog: {
        zIndex: getZIndex('modal'),
        paddingRight: bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth() : void 0,
        paddingLeft:  !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth() : void 0
      },
      backdrop: {
        zIndex: getZIndex('backdrop')
      }
    }
  }
github react-bootstrap / react-bootstrap / src / Modal.js View on Github external
const document = ownerDocument(dialogNode);
    const bodyIsOverflowing = isOverflowing(
      ReactDOM.findDOMNode(this.props.container || document.body)
    );
    const modalIsOverflowing =
      dialogHeight > document.documentElement.clientHeight;

    this.setState({
      style: {
        paddingRight:
          bodyIsOverflowing && !modalIsOverflowing
            ? getScrollbarSize()
            : undefined,
        paddingLeft:
          !bodyIsOverflowing && modalIsOverflowing
            ? getScrollbarSize()
            : undefined
      }
    });
  }
github jquense / react-bootstrap-modal / src / Modal.js View on Github external
_getStyles() {
    if (!canUseDOM)
      return {}

    let node = findDOMNode(this.dialog)
      , doc = ownerDocument(node)
      , scrollHt = node.scrollHeight
      , bodyIsOverflowing = isOverflowing(this.props.container || doc.body)
      , modalIsOverflowing = scrollHt > doc.documentElement.clientHeight

    return {
      dialog: {
        zIndex: getZIndex('modal'),
        paddingRight: bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth() : void 0,
        paddingLeft:  !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth() : void 0
      },
      backdrop: {
        zIndex: getZIndex('backdrop')
      }
    }
  }
github iuap-design / bee.tinper.org / tinper-bee / bee-modal / src / Modal.js View on Github external
const document = ownerDocument(dialogNode);
    let bodyIsOverflowing=false;
    if(this.props.container){
      bodyIsOverflowing = isOverflowing(
        ReactDOM.findDOMNode(this.props.container)
      );
    }
    const modalIsOverflowing =
      dialogHeight > document.documentElement.clientHeight;

    this.setState({
      style: {
        paddingRight: bodyIsOverflowing && !modalIsOverflowing ?
          getScrollbarSize() : undefined,
        paddingLeft: !bodyIsOverflowing && modalIsOverflowing ?
          getScrollbarSize() : undefined
      }
    });
  }
  //ResizeStart 时,若模态框设置了 `centered` ,需要把居中属性移除,并通过 offsetTop 制造垂直居中的假象
github iuap-design / bee.tinper.org / tinper-bee / bee-modal / src / Modal.js View on Github external
const dialogHeight = dialogNode.scrollHeight;

    const document = ownerDocument(dialogNode);
    let bodyIsOverflowing=false;
    if(this.props.container){
      bodyIsOverflowing = isOverflowing(
        ReactDOM.findDOMNode(this.props.container)
      );
    }
    const modalIsOverflowing =
      dialogHeight > document.documentElement.clientHeight;

    this.setState({
      style: {
        paddingRight: bodyIsOverflowing && !modalIsOverflowing ?
          getScrollbarSize() : undefined,
        paddingLeft: !bodyIsOverflowing && modalIsOverflowing ?
          getScrollbarSize() : undefined
      }
    });
  }
  //ResizeStart 时,若模态框设置了 `centered` ,需要把居中属性移除,并通过 offsetTop 制造垂直居中的假象