Skip to content

body overflow:scroll issue on new Portal.js HOC Overlay #448

@joevbruno

Description

@joevbruno

In the new HOC (react-toolbox/components/hoc/Portal.js), the unrenderOverlay method causes a horizontal scrollbar to appear unnecessarily in at least Google Chrome. Furthermore, because it appears as an inline style, it's specificy wins. In the code below, document.body.style.overflow needs to be set to null instead of 'scroll'. I am happy to submit this fix as a pull request. Am I missing something that requires the body style to be set to scroll?

 _unrenderOverlay () {
    if (this._overlayTarget) {
      if (this.props.lockBody) document.body.style.overflow = 'scroll';
      ReactDOM.unmountComponentAtNode(this._overlayTarget);
      this._overlayInstance = null;
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions