• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

Stop a web page from scrolling whereas a dialog is open

Admin by Admin
December 2, 2025
Home Coding
Share on FacebookShare on Twitter


Bramus:

Chrome 144 encompasses a small change to overscroll-behavior: it now additionally works on non-scrollable scroll containers. Whereas this modification may appear trivial, it fixes a difficulty builders have been coping with for ages: forestall a web page from scrolling whereas a (modal) 

 is open.

YES! Means again in 2019, I labored on “Stop Web page Scrolling When a Modal is Open” with Brad Wu about this precise factor. Apparently this was mere months earlier than we obtained our fingers on the true HTML

component. In any case, you may see the difficulty with energetic scrolling when a “dialog” is open:

The issue is that the dialog itself isn’t a scroll container. If it was, we may slap overscroll-behavior: comprise on it and be achieved with it. Brad demoed his answer that concerned a JavaScript-y strategy that units the to mounted positioning when the dialog is in an open state:

That’s the tweak Bramus is speaking about. In Chrome 144, that’s not the case. Going again to that first demo, we are able to do a few issues to keep away from all of the JS mumbo-jumbo.

First, we declare overscroll-behavior on each the dialog component and the backdrop and set it to comprise:

physique {
  overscroll-behavior: comprise;
}

#dialog {
  overscroll-behavior: comprise;
}

You’d suppose that may do it, however there’s a brilliant key last step. That dialog must be a scroll container, which we are able to do explicitly:

#dialog {
  overscroll-behavior: comprise;
  overflow: hidden;
}

Chrome 144 wanted, after all:

The demo that Bramus offered is far, significantly better because it offers with the precise HTML

component and its ::backdrop:


Direct Hyperlink →

Tags: DialogOpenPagePreventscrolling
Admin

Admin

Next Post
Google Fixes Android Zero-Day Flaws Actively Exploited within the Wild

Google Fixes Android Zero-Day Flaws Actively Exploited within the Wild

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

The use (and design) of instruments

To make certain | Seth’s Weblog

January 8, 2026
My Tackle the 7 Greatest Enterprise Course of Administration Software program

My Tackle the 7 Greatest Enterprise Course of Administration Software program

May 8, 2025

Trending.

The way to Clear up the Wall Puzzle in The place Winds Meet

The way to Clear up the Wall Puzzle in The place Winds Meet

November 16, 2025
Mistral AI Releases Voxtral TTS: A 4B Open-Weight Streaming Speech Mannequin for Low-Latency Multilingual Voice Era

Mistral AI Releases Voxtral TTS: A 4B Open-Weight Streaming Speech Mannequin for Low-Latency Multilingual Voice Era

March 29, 2026
Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

March 16, 2026
Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

January 5, 2026

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

Credulous

Settling | Seth’s Weblog

April 12, 2026
Banks Penalize Unhealthy Cybersecurity With Greater Charges

Banks Penalize Unhealthy Cybersecurity With Greater Charges

April 12, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved