Topic: Modal - overflow-y-scroll

Darin Heuermann free asked 2 years ago


Expected behavior When opening a modal, overflow-y-scroll should not be added to the body classes.

Actual behavior When opening a modal, overflow-y-scroll is added to the body classes. This causes a scrollbar to appear on pages that do not already have a scrollbar. The addition of the scrollbar causes a layout to occur and things to shift around. This is very jarring when opening a modal.

HTML when modal open

<body class="modal-open overlow-y-scroll">

Question Is there some way to turn off this behavior that adds overflow-y-scroll to the body classes?


Piotr Glejzer staff commented 2 years ago

Try to add prop overflowScroll to false



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.27.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No