Skip to content

[web] In-Browser Zoom not working with Ctrl + Scroll #68512

@BrayFlex

Description

@BrayFlex

Steps to Reproduce

  1. Run flutter create bug
  2. Hold Ctrl and scroll wheel up/down

Expected results:
Browser should adjust its zoom level in or out.

Actual results:
Browser did not adjust its zoom level.

Logs
[√] Flutter (Channel beta, 1.23.0-18.1.pre, on Microsoft Windows [Version    10.0.18363.1139], locale en-US)
    • Flutter version 1.23.0-18.1.pre at
      C:\Users\Brayden\Documents\SDK\flutter
    • Framework revision 198df796aa (4 days ago), 2020-10-15 12:04:33    
      -0700
    • Engine revision 1d12d82d9c
    • Dart version 2.11.0 (build 2.11.0-213.1.beta)

 
[√] Android toolchain - develop for Android devices (Android SDK version 
    29.0.3)
    • Android SDK at C:\Users\Brayden\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android
      Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files
      (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.49.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.15.1

[√] Connected device (3 available)
    • Web Server (web) • web-server • web-javascript • Flutter Tools     
    • Chrome (web)     • chrome     • web-javascript • Google Chrome     
      86.0.4240.75
    • Edge (web)       • edge       • web-javascript • Microsoft Edge    
      86.0.622.38

• No issues found!

Notes:

  • Ctrl + - & Ctrl + + work, this seems specifically to an issue with the default scroll wheel behavior being ignored.
  • I tried looking into it on the engine code and found this:

engine\lib\web_ui\lib\src\engine\pointer_binding.dart

ln 493

    _addWheelEventListener((html.Event event) {
      assert(event is html.WheelEvent);
      if (_debugLogPointerEvents) {
        print(event.type);
      }
      _callback(_convertWheelEventToPointerData(event as html.WheelEvent));
      // Prevent default so mouse wheel event doesn't get converted to
      // a scroll event that semantic nodes would process.
      event.preventDefault();
    });

ln 772

    _addWheelEventListener((html.Event event) {
      assert(event is html.WheelEvent);
      if (_debugLogPointerEvents) {
        print(event.type);
      }
      _callback(_convertWheelEventToPointerData(event as html.WheelEvent));
      // Prevent default so mouse wheel event doesn't get converted to
      // a scroll event that semantic nodes would process.
      event.preventDefault();
    });

Maybe these event preventions are blocking the default browser behavior? Just a guess.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.found in release: 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specifically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions