Disable body-level scrolling when a dialog is open as a modal

Created on 15 April 2016, over 8 years ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

When a dialog is opened with the "modal" option, all other elements on the page are hypothetically disabled. Even though those other elements are masked, you can still scroll-through the modal to the body, which is awkward and not expected behavior. This can lead to the user being confused after closing a modal as the page has scrolled past where they initiated the modal originally.

Proposed resolution

Disable body-level scrolling when a dialog is opened as a modal, which should address this problem.

Dependency evaluation

tua-body-scroll-lock

  • Maintainership of the package: Project is actively maintained. Last release happened on 18th of July 2023.
  • Security policies of the package: None
  • Code quality: Small UI library, could be maintained by us but since the library needs to chase HEAD on multiple browsers, probably better if that's done by someone else.
  • Other dependencies it would add, if any: none

Release notes snippet

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
Javascript 

Last updated 2 days ago

Created by

🇺🇸United States samuel.mortenson

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024