✅ PARENT PAGE SCROLL
0px

✅ Issue #156985 - AFTER FIX

Demonstrating scroll event containment with browserScrolling: true

✅ FIXED STATE

When you scroll inside the Flutter app below (the green-bordered iframe), ONLY the Flutter app scrolls - the parent page stays still. Watch the scroll indicator in the top-right corner - it should NOT change!

📋 How to Test

  1. Hover your mouse over the Flutter app iframe below (green border)
  2. Use your mouse wheel or trackpad to scroll
  3. Watch the scroll indicator in the top-right corner
  4. Notice that only the Flutter content scrolls - the parent page stays at 0px!

📖 About This Issue

GitHub Issue: #156985

Problem: When a Flutter web app is embedded in an iframe with a fixed position, and contains a ListView inside a SingleChildScrollView, scroll events bubble up to the parent page, causing both to scroll simultaneously.

Root Cause: Without browserScrolling: true, Flutter intercepts wheel and touch events. Inside an iframe, these events aren't properly contained, so they propagate back to the parent document.

Solution: Add browserScrolling: true to the SingleChildScrollView and wrap nested scrollables with BrowserScrollZone for boundary detection.

🖼️ Flutter App (Embedded in iframe)

The Flutter app below is embedded in a fixed-position iframe with browserScrolling: true. Try scrolling inside it - the parent page should NOT scroll!

📊 Content Section 1

This is content on the parent page. Notice that when you scroll inside the Flutter app above, this parent page content does NOT scroll!

The scroll indicator in the top-right corner shows the parent page's scroll position. With browserScrolling: true, it stays at 0px when scrolling inside the Flutter iframe!

🔬 Content Section 2

This section exists to provide scrollable content on the parent page, making it easier to observe that scroll events are properly contained.

With browserScrolling: true, scrolling inside the Flutter iframe does NOT affect this parent page - the fix works!

🎯 Content Section 3

The issue is particularly problematic for:

💡 Content Section 4

The fix involves two key changes:

  1. Add browserScrolling: true to SingleChildScrollView
  2. Wrap nested scrollables with BrowserScrollZone for boundary detection

This allows the browser to handle scrolling natively while still supporting Flutter's custom scroll physics and nested scrolling.