Skip to content

Scrollbar do not handle wheel event when cursor is over the track #109519

Closed

Description

@fufesou

Use case

The api doc examples.

Scrollbar does not scroll when the cursor is over the track.

Proposal

I find no related questions about this feature. But I think it's a common use that scroll mouse wheel when the cursor is over the track.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Aug 15, 2022
  2. exaby73 commented on Aug 15, 2022

    @exaby73
    Member

    Hello @fufesou. I can reproduce this issue on Windows and Web.

    Code sample (From docs)
    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({Key? key}) : super(key: key);
    
      static const String _title = 'Flutter Code Sample';
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: _title,
          home: Scaffold(
            appBar: AppBar(title: const Text(_title)),
            body: const Center(
              child: MyStatefulWidget(),
            ),
          ),
        );
      }
    }
    
    class MyStatefulWidget extends StatefulWidget {
      const MyStatefulWidget({Key? key}) : super(key: key);
    
      @override
      State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
    }
    
    class _MyStatefulWidgetState extends State<MyStatefulWidget> {
      final ScrollController _firstController = ScrollController();
    
      @override
      Widget build(BuildContext context) {
        return LayoutBuilder(
            builder: (BuildContext context, BoxConstraints constraints) {
              return Row(
                children: <Widget>[
                  SizedBox(
                      width: constraints.maxWidth / 2,
                      // Only one scroll position can be attached to the
                      // PrimaryScrollController if using Scrollbars. Providing a
                      // unique scroll controller to this scroll view prevents it
                      // from attaching to the PrimaryScrollController.
                      child: Scrollbar(
                        thumbVisibility: true,
                        controller: _firstController,
                        child: ListView.builder(
                            controller: _firstController,
                            itemCount: 100,
                            itemBuilder: (BuildContext context, int index) {
                              return Padding(
                                padding: const EdgeInsets.all(8.0),
                                child: Text('Scrollable 1 : Index $index'),
                              );
                            }),
                      )),
                  SizedBox(
                      width: constraints.maxWidth / 2,
                      // This vertical scroll view has not been provided a
                      // ScrollController, so it is using the
                      // PrimaryScrollController.
                      child: Scrollbar(
                        thumbVisibility: true,
                        child: ListView.builder(
                            itemCount: 100,
                            itemBuilder: (BuildContext context, int index) {
                              return Container(
                                  height: 50,
                                  color: index.isEven
                                      ? Colors.amberAccent
                                      : Colors.blueAccent,
                                  child: Padding(
                                    padding: const EdgeInsets.all(8.0),
                                    child: Text('Scrollable 2 : Index $index'),
                                  ));
                            }),
                      )),
                ],
              );
            });
      }
    }
    flutter doctor -v (Stable)
    [✓] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22000.856], locale en-IN)
        • Flutter version 3.0.5 at C:\Users\Nabeel Parkar\fvm\versions\stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at C:\android-sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe
    
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.2.32630.192
        • Windows 10 SDK version 10.0.19041.0
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2022.2
        • Flutter plugin version 69.0.5
        • Dart plugin version 222.3345.108
    
    [✓] VS Code (version 1.70.1)
        • VS Code at C:\Users\Nabeel Parkar\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.46.0
    
    [✓] Connected device (3 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.856]
        • Chrome (web)      • chrome  • web-javascript • unknown
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.54
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    flutter doctor -v (Master)
    [✓] Flutter (Channel master, 3.1.0-0.0.pre.2272, on Microsoft Windows [Version 10.0.22000.856], locale en-IN)
        • Flutter version 3.1.0-0.0.pre.2272 on channel master at C:\Users\Nabeel Parkar\fvm\versions\master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ed3238e8ed (5 hours ago), 2022-08-14 20:54:09 -0400
        • Engine revision cc9f4c63b7
        • Dart version 2.19.0 (build 2.19.0-96.0.dev)
        • DevTools version 2.16.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at C:\android-sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe
    
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.2.32630.192
        • Windows 10 SDK version 10.0.19041.0
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2022.2
        • Flutter plugin version 69.0.5
        • Dart plugin version 222.3345.108
    
    [✓] VS Code (version 1.70.1)
        • VS Code at C:\Users\Nabeel Parkar\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.46.0
    
    [✓] Connected device (3 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.856]
        • Chrome (web)      • chrome  • web-javascript • unknown
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.54
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Aug 15, 2022
  4. self-assigned this
    on Aug 15, 2022
  5. added
    P2Important issues not at the top of the work list
    on Aug 18, 2022
  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 7, 2022
  7. github-actions commented on Nov 21, 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.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopf: scrollingViewports, list views, slivers, etc.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions