Skip to content

Horizontal edge scrolling is broken #64059

Open

Description

@justinmc

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.

edge_scroll

Steps to Reproduce

  1. Run an app with a one-line TextField (code below).
  2. Enter enough text to go beyond the edge of the screen.
  3. Scroll back to the beginning.
  4. Start a selection, and drag the right selection handle to the right edge of the input.
  5. 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!

Activity

  1. justinmc commented on Aug 18, 2020

    @justinmc
    ContributorAuthor

    Strangely, there are tests for this, and they seem to be passing:

    testWidgets('long press drag can edge scroll', (WidgetTester tester) async {

    testWidgets('long press drag can edge scroll', (WidgetTester tester) async {

    testWidgets('long press drag can edge scroll', (WidgetTester tester) async {

    Update: I skipped the test in selectable_text_test here. It should be unskipped when this issue is fixed.

  2. darshankawar commented on Aug 19, 2020

    @darshankawar
    Member

    Replicable on latest Stable (1.20.2) as well. When trying to manually scroll and select entire text, the last letter is left off.

    Screen Shot 2020-08-19 at 1 32 23 PM

    Also, unable to move the cursor to far left, ie, at starting position of first letter.

    Screen Shot 2020-08-19 at 1 32 34 PM

    Tested on Android 8.1.0 device.

    flutter doctor -v
    Flutter 1.20.2 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision bbfbf1770c (15 hours ago) • 2020-08-13 08:33:09 -0700
    Engine • revision 9d5b21729f
    Tools • Dart 2.9.1
    
    Running flutter doctor...
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.2 19C57, locale en-US)
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        ✗ Android license status unknown.
          Try re-installing or updating your Android SDK Manager.
          See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
    [✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    [✓] Android Studio (version 3.6)
    [✓] Connected device (1 available)
    
    ! Doctor found issues in 1 category.
    
    
    
  3. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-androidAndroid applications specifically
    platform-iosiOS applications specifically
    on Aug 19, 2020
  4. armanshahria945 commented on Aug 20, 2020

    @armanshahria945

    testWidgets('long press drag can edge scroll', (WidgetTester tester) async {

  5. added
    team: skip-testAn issue used to track tests that are skipped.
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    c: tech-debtTechnical debt, code quality, testing, etc.
    on Aug 7, 2021
  6. maheshj01 commented on Dec 19, 2022

    @maheshj01
    Member

    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
    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: 'Material App',
          theme: ThemeData.dark(),
          home: const Home(),
        );
      }
    }
    
    class Home extends StatefulWidget {
      const Home({super.key});
    
      @override
      _HomeState createState() => _HomeState();
    }
    
    class _HomeState extends State<Home> {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: const Text('Material'),
          ),
          body: ListView(
            scrollDirection: Axis.horizontal,
            children: const <Widget>[
              SelectableText('This is a selectable text widget that is very long and will not wrap to the next line. Because its horizontal, it will scroll. Add more text to see it scroll. And even more'),
            ],
          ),
        );
      }
    }
    flutter doctor -v (mac)
    [✓] Flutter (Channel master, 3.7.0-3.0.pre.33, on macOS 12.6 21G115 darwin-arm64, locale en-IN)
        • Flutter version 3.7.0-3.0.pre.33 on channel master 
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 5201856805 (38 minutes ago), 2022-12-05 18:27:21 -0800
        • Engine revision a309d239c4
        • Dart version 2.19.0 (build 2.19.0-463.0.dev)
        • DevTools version 2.20.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
          to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-33, build-tools 33.0.0-rc4
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.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 11.0.12+0-b1504.28-7817840)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.70.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.55.20221129
    
    [✓] Connected device (3 available)
        • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.6 21G115 darwin-arm64
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.94
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [✓] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-arm, locale en-IN)
        • Flutter version 3.3.9 on channel stable at /Users/mahesh/Development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision b8f7f1f986 (24 hours ago), 2022-11-23 06:43:51 +0900
        • Engine revision 8f2221fbef
        • Dart version 2.18.5
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-33, build-tools 33.0.0-rc4
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.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 11.0.12+0-b1504.28-7817840)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.70.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.53.20221101
    
    [✓] Connected device (3 available)
        • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.6 21G115 darwin-arm
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 107.0.5304.110
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
  7. 7 remaining items

  8. added and removed
    team-designOwned by Design Languages team
    triaged-designTriaged by Design Languages team
    on Mar 4, 2025
  9. justinmc commented on Mar 21, 2025

    @justinmc
    ContributorAuthor

    This still reproduces today. I'm on master running an Android emulator on API 34.

  10. justinmc commented on Mar 27, 2025

    @justinmc
    ContributorAuthor

    Per @Renzo-Olivares this may be an Android-only bug and not appear on iOS? We should double check that.

  11. added
    P2Important issues not at the top of the work list
    on Apr 10, 2025
  12. Renzo-Olivares commented on May 15, 2025

    @Renzo-Olivares
    Contributor
    Screen.Recording.2025-05-15.at.10.15.07.AM.mov

    I think this issue completely goes away if the TextField does 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.

  13. added
    f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIs
    on Jan 22, 2026
  14. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
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

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: contributor-productivityTeam-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-text-inputOwned by Text Input teamteam: skip-testAn issue used to track tests that are skipped.triaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions