Repository navigation
Scrollbar gesture recognizers not updated on scroll extent change #150342
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Run flutter create and replace main.dart with the provided code sample.
- Run on macOS
- Wait a few seconds for the text in the TextField to appear
- Do a scroll gesture over the Text using the trackpad
- Move the mouse pointer outside of the app window or tap on the app bar
- Again, do a scroll gesture over the Text using the trackpad
Expected results
Consistent trackpad scroll behaviour, identical list of gesture recognizers.
Actual results
Inconsistent trackpad scroll behaviour, different list of gesture recognizers.
Before text update:
flutter: Gesture arena 2 ❙ ★ Opening new gesture arena.
flutter: Gesture arena 2 ❙ Adding: VerticalDragGestureRecognizer#8b17a(start behavior: start)
flutter: Gesture arena 2 ❙ Closing with 1 member.
flutter: Gesture arena 2 ❙ Default winner: VerticalDragGestureRecognizer#8b17a(start behavior: start)
After text update:
flutter: Gesture arena 4 ❙ ★ Opening new gesture arena.
flutter: Gesture arena 4 ❙ Adding: VerticalDragGestureRecognizer#8b17a(start behavior: start)
flutter: Gesture arena 4 ❙ Adding: _VerticalThumbDragGestureRecognizer#293c1(debugOwner: _MaterialScrollbarState#10516(tickers: tracking 2 tickers), start behavior: down)
flutter: Gesture arena 4 ❙ Adding: _VerticalThumbDragGestureRecognizer#eacad(debugOwner: _MaterialScrollbarState#1f937(tickers: tracking 2 tickers), start behavior: down)
flutter: Gesture arena 4 ❙ Closing with 3 members.
flutter: Gesture arena 4 ❙ Accepting: _VerticalThumbDragGestureRecognizer#293c1(debugOwner: _MaterialScrollbarState#10516(tickers: tracking 2 tickers), start behavior: down)
flutter: Gesture arena 4 ❙ Self-declared winner: _VerticalThumbDragGestureRecognizer#293c1(debugOwner: _MaterialScrollbarState#10516(tickers: tracking 2 tickers), start behavior: down)
Code sample
Code sample
import 'package:flutter/gestures.dart' show debugPrintGestureArenaDiagnostics;
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final ScrollController _scrollController = ScrollController();
final TextEditingController _textEditingController = TextEditingController();
@override
void initState() {
super.initState();
debugPrintGestureArenaDiagnostics = true;
Future.delayed(const Duration(milliseconds: 3000), () {
_textEditingController.text =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt '
'ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco '
'laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in '
'voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat '
'non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n' * 10;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Wait for it...'),
Expanded(
child: Scrollbar(
controller: _scrollController,
child: ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(
scrollbars: false,
physics: const BouncingScrollPhysics(),
),
child: TextField(
controller: _textEditingController,
scrollController: _scrollController,
maxLines: null,
),
),
),
),
],
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
% flutter doctor -v
[✓] Flutter (Channel master, 3.23.0-13.0.pre.242, on macOS 14.5 23F79 darwin-arm64, locale en-ES)
• Flutter version 3.23.0-13.0.pre.242 on channel master at /Users/tgucio/Library/Frameworks/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5187cab7bd (2 days ago), 2024-06-14 23:35:34 -0400
• Engine revision 9779c273aa
• Dart version 3.5.0 (build 3.5.0-266.0.dev)
• DevTools version 2.36.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/tgucio/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 17.0.9+0-17.0.9b1087.7-11185874)
[✓] VS Code (version 1.90.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.5 23F79 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142
[✓] Network resources
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team

Activity
tgucio commentedon Jun 17, 2024
This appears to happen on scroll extent changes occurring after the initial RawScrollbarState gesture recognizers are created:
The
_handleScrollNotificationmethod handlesmaxScrollExtentextent changes only to fade out the scrollbar when there's nothing to scroll, but does not rebuild the widget (which would create new recognisers) when the previously non-scrollable content grows to scrollable.tgucio commentedon Jun 17, 2024
/cc @HansMuller
danagbemava-nc commentedon Jun 17, 2024
Reproducible using the code sample provided above.
It appears to work as expected on
stable 3.22.2but the issue appears onmasterLabeling for further investigation
Screen.Recording.2024-06-17.at.11.30.52.mov
Screen.Recording.2024-06-17.at.11.32.15.mov
flutter doctor -v
HansMuller commentedon Jun 17, 2024
See: #149999 (comment)
HansMuller commentedon Jun 21, 2024
Fixed in #150275
Improve the behavior of scrollbar drag-scrolls triggered by the track…
Improve the behavior of scrollbar drag-scrolls triggered by the track…
github-actions commentedon Jul 11, 2024
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 -vand a minimal reproduction of the issue.