Repository navigation
Horizontal edge scrolling is broken #64059
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyplatform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamteam: skip-testAn issue used to track tests that are skipped.An issue used to track tests that are skipped.triaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Horizontal edge scrolling appears to be broken. I've tried it on iOS and Android emulators and on a physical Pixel 2. I've tried TextField and SelectableText. The bug is present in all of these cases.
CupertinoTextField seems to have slightly better luck. It sometimes feels ok on the physical Pixel 2. On the Android emulator, I see some movement, but it's not really possible to scroll to the far right in one movement.
Steps to Reproduce
- Run an app with a one-line TextField (code below).
- Enter enough text to go beyond the edge of the screen.
- Scroll back to the beginning.
- Start a selection, and drag the right selection handle to the right edge of the input.
- The input doesn't scroll, and it's not possible to select the rightmost text without stopping the gesture.
Code
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material'),
),
body: ListView(
children: <Widget>[
TextField(
maxLines: 1,
),
],
),
);
}
}flutter doctor -v
flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-10.0.pre.114, on Mac OS X 10.15.6 19G73, locale en-US)
• Flutter version 1.21.0-10.0.pre.114 at /Users/jmccandless/Projects/flutter
• Framework revision b2c0970aa7 (2 days ago), 2020-08-16 06:11:02 -0400
• Engine revision b300be3df3
• Dart version 2.10.0 (build 2.10.0-34.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/jmccandless/Library/Android/sdk
• Platform android-29, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 12.0, Build version 12A6159
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (6 available)
• Pixel 2 XL (mobile) • 709KPNY0023559 • android-arm64 • Android 10 (API 29)
• sdk gphone x86 64 (mobile) • emulator-5554 • android-x64 • Android 11 (API 30) (emulator)
• iPhone SE (2nd generation) (mobile) • 95E2AF70-6B9B-4290-931D-94E05637CBE8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.6 19G73
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 84.0.4147.125
• 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 lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyplatform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamteam: skip-testAn issue used to track tests that are skipped.An issue used to track tests that are skipped.triaged-text-inputTriaged by Text Input teamTriaged by Text Input team

Activity
justinmc commentedon Aug 18, 2020
Strangely, there are tests for this, and they seem to be passing:
flutter/packages/flutter/test/material/text_field_test.dart
Line 6738 in 61362cf
flutter/packages/flutter/test/widgets/selectable_text_test.dart
Line 2873 in 61362cf
flutter/packages/flutter/test/cupertino/text_field_test.dart
Line 1966 in 61362cf
Update: I skipped the test in selectable_text_test here. It should be unskipped when this issue is fixed.
darshankawar commentedon Aug 19, 2020
Replicable on latest Stable (1.20.2) as well. When trying to manually scroll and select entire text, the last letter is left off.
Also, unable to move the cursor to far left, ie, at starting position of first letter.
Tested on Android 8.1.0 device.
flutter doctor -v
armanshahria945 commentedon Aug 20, 2020
flutter/packages/flutter/test/widgets/selectable_text_test.dart
Line 2873 in 61362cf
maheshj01 commentedon Dec 19, 2022
Reproduces with stable 3.3 and master 3.7, Edge scroll does not work in both directions.
Also reproduces with SelectableText widget
code sample for SelectableText
flutter doctor -v (mac)
7 remaining items
justinmc commentedon Mar 21, 2025
This still reproduces today. I'm on master running an Android emulator on API 34.
justinmc commentedon Mar 27, 2025
Per @Renzo-Olivares this may be an Android-only bug and not appear on iOS? We should double check that.
Renzo-Olivares commentedon May 15, 2025
Screen.Recording.2025-05-15.at.10.15.07.AM.mov
I think this issue completely goes away if the
TextFielddoes not take up the entire width of the screen. Likely what's happening when it takes up the full width of the screen is that the pointer loses contact with the hit test area and ends the gesture which prevents us from revealing anymore of the text in the field.