⚠️ PARENT PAGE SCROLL
0px

❌ Issue #156985 - BEFORE FIX

Demonstrating scroll event bubbling from iframe to parent page

⚠️ BROKEN STATE

When you scroll inside the Flutter app below (the red-bordered iframe), BOTH the Flutter app AND this parent page will scroll together. Watch the scroll indicator in the top-right corner!

📋 How to Test

  1. Hover your mouse over the Flutter app iframe below (red border)
  2. Use your mouse wheel or trackpad to scroll
  3. Watch the scroll indicator in the top-right corner
  4. Notice that both the Flutter content and this parent page scroll

📖 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. Try scrolling inside it and watch what happens to this parent page!

📊 Content Section 1

This is content on the parent page. Notice that when you scroll inside the Flutter app above, this parent page content also scrolls.

The scroll indicator in the top-right corner shows the parent page's scroll position. It should NOT change when scrolling inside the Flutter iframe, but in this broken state, it does!

🔬 Content Section 2

This section exists to provide scrollable content on the parent page, making it easier to observe the scroll bubbling behavior.

In the fixed version (with browserScrolling: true), scrolling inside the Flutter iframe would NOT affect this parent page.

🎯 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.