Home / Companies / Webflow / Blog / Post Details
Content Deep Dive

How to Prevent Page Scroll When a Modal Is Open in Webflow + the iOS Safari Fix

Blog post from Webflow

Post Details
Company
Date Published
Author
Webflow Team
Word Count
1,740
Language
English
Hacker News Points
-
Summary

The text addresses the persistent issue of background scrolling when modals are open in Webflow, particularly noting the challenge on iOS Safari due to its unique handling of scroll behaviors. It explains that while desktop browsers like Chrome and Firefox respect the overflow: hidden CSS property to prevent page scrolling, iOS Safari does not, due to Apple's implementation of scrolling as a native gesture beyond CSS control. The guide offers solutions for scroll prevention in Webflow, including a jQuery method that provides control and works reliably on desktop and Android, and a no-code option using Finsweet Attributes, which offers convenience but still faces challenges with iOS Safari. Both solutions require specific steps, such as adding class names to modal elements and implementing custom code or attributes in Webflow's settings, to ensure that background scrolling is prevented when modals are active. The advanced methods section offers a comprehensive strategy for iOS Safari, emphasizing that the method choice should consider the significance of mobile conversions for the site.