Skip to content

[webview_flutter] Scrolling and tapping behavior differs on iOS 26 #171568

@felixkwok2

Description

@felixkwok2

Steps to reproduce

  1. Create a scroll view
  2. Put a WebViewWidget inside scroll view
  3. Wrap the WebViewWidget with IgnorePointer and GestureDetector widget
SingleChildScrollView(
  child: Column(
    children: <Widget>[
      /// other widgets,
      GestureDetector(
        behavior: HitTestBehavior.opaque,
        onTap: () {
          // show a snack
        },
        child: IgnorePointer(
          child: WebViewWidget(controller: controller),
        ),
      ),
      /// other widgets,
    ],
  ),
)
  1. Run the app on iOS 18 & iOS 26 Simulator
  2. Drag inside the web view

(using webview_flutter 4.13.0)

Expected results

A static web view should display a preview of the website.
It should not allow scrolling or tapping.

(We were trying to show the website as a static preview. Upon tapping the preview web view, a full-screen, fully-interactive web view will be displayed)

Actual results

In iOS 18, it work as expected.

  • static preview
  • clicking the item inside webview would trigger GestureDetector.onTap instead of trigger web page click

In iOS 26,

  • the web view is scrollable and clickable

Code sample

Code sample
Scaffold(
  appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text("Demo")),
  body: SingleChildScrollView(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Container(height: 500),
        const Text('Below is web view'),
        Container(
          color: Colors.green,
          height: 400,
          padding: EdgeInsets.all(8.0),
          child: GestureDetector(
            behavior: HitTestBehavior.opaque,
            onTap: () {
              ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('WebView tapped!')));
            },

            child: IgnorePointer(child: WebViewWidget(controller: controller)),
          ),
        ),
        const Text('Above is web view'),
        Container(height: 500),
      ],
    ),
  ),
);

Screenshots or Video

Screenshots / Video demonstration

Image

The left simulator is using iOS 18 and works as expected.
The right simulator is using iOS 26 and behaves differently.

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel [user-branch], 3.29.3, on macOS 15.5 24F74 darwin-arm64, locale en-GB)
    ! Flutter version 3.29.3 on channel [user-branch] at /Users/felixkwok/Documents/flutter_sdk/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.101.2)
[✓] Connected device (7 available)
[✓] Network resources

! Doctor found issues in 1 category.
dependencies
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.8
  webview_flutter: ^4.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: OS-version specificAffects only some versions of the relevant operating systemp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    Status

    Not started

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy