Skip to content

Missing scrolling inertia on iPadOS when using trackpad #97084

Closed

Description

@singularity-s0

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. Connect an external trackpad to iPad (in this case, I am using the Magic Keyboard)
  3. Use the two-finger scroll gesture

Expected results:
Scrolling animation should not stop when I lift my fingers from the trackpad. It should have inertia, just like when using touch input or when scrolling on computers.

Actual results:
Scrolling animation stops abruptly when I lift my fingers from the trackpad.

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    var text = "Example Text ";
    for (var i in Iterable.generate(100)) {
      text = text + i.toString() + '\n';
    }
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SingleChildScrollView(
        child: Text(
          text,
        ),
      ),
    );
  }
}
Logs
No log at all! even with --verbose (except at build time) 
I guess scroll event simply isn't logged.
Analyzing flutter_application_1...                                      
No issues found! (ran in 3.0s)
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-US)
    • Flutter version 2.8.1 at /Users/user/Projects/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (3 available)
(devices omitted)

Video:

RPReplay_Final1642906616.MP4

Comparing trackpad scroll vs finger scroll (the transparent dot indicates trackpad is being used)

Activity

  1. darshankawar commented on Jan 24, 2022

    @darshankawar
    Member

    @singularity-s0
    By missing scrolling inertia, do you mean when we try to flung scrollbar, it doesn't scroll correct ?
    If so, can you check if this issue is similar to your case ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 24, 2022
  3. singularity-s0 commented on Jan 24, 2022

    @singularity-s0
    Author

    @singularity-s0

    By missing scrolling inertia, do you mean when we try to flung scrollbar, it doesn't scroll correct ?

    If so, can you check if this issue is similar to your case ?

    Hi, thanks for the reply.

    No, this issue has nothing to do with scrollbar. As you can see in the video no scrollbar activity is involved.

    This issue occurs when one uses the two-finger scroll gesture on external trackpads connected to an iPad. It is quite obvious.

    Scrolling with other input is not affected.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 24, 2022
  5. darshankawar commented on Jan 25, 2022

    @darshankawar
    Member

    @singularity-s0
    Can you try to see what does ScrollPosition.isScrollingNotifier returns if you use two-finger gesture to scroll using trackpad ? Does it return false or true using something like:

    final ScrollController controller = ScrollController();
    
      @override
      void initState() {
        controller.addListener(() {
          // always prints "scrolling = true"
          print('scrolling = ${controller.position.isScrollingNotifier.value}');
        });
        super.initState();
      }
    
      @override
      void dispose() {
        controller.dispose();
        super.dispose();
      }
    
  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 25, 2022
  7. singularity-s0 commented on Jan 25, 2022

    @singularity-s0
    Author

    It prints false when scrolling with trackpad and true when scrolling with finger.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 25, 2022
  9. darshankawar commented on Jan 26, 2022

    @darshankawar
    Member

    @singularity-s0
    Thanks for verifying. Based on your finding, I believe you are hitting #75591, so I suggest you to follow-up in it for further updates.
    Closing this as a duplicate. If you disagree, write in comments and I'll reopen it.

  10. added
    r: duplicateIssue is closed as a duplicate of an existing issue
    and removed
    in triagePresently being triaged by the triage team
    on Jan 26, 2022
  11. github-actions commented on Feb 9, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions