Repository navigation
Closed
Closed
Copy link
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 problemsf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.41Found to occur in 3.41Found to occur in 3.41frameworkflutter/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: solvedIssue is closed as solvedIssue is closed as solvedteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
- Run code
- Long press a word near the bottom of the text field to select it (and then end the long-press)
- Tap the selection handle at the start of the highlighted word, and drag it upwards
Expected results
The text field should scroll smoothly (as it does if you do not end the long-press at the end of step 2. but simply drag finger upwards immediately)
Actual results
The scrolling jumps around -- see video here
scroll-bug.mov
('Screenshots or video' section isn't showing up for some reason)
Code sample
Code sample
import 'dart:io';
import 'package:flutter/cupertino.dart';
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 TextEditingController _textEditingController = TextEditingController(
text:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque sodales ut etiam sit amet nisl. Molestie nunc non blandit massa enim nec dui. Ornare quam viverra orci sagittis eu volutpat odio. In vitae turpis massa sed elementum tempus. Laoreet non curabitur gravida arcu ac tortor dignissim. In cursus turpis massa tincidunt dui ut ornare lectus sit. Enim praesent elementum facilisis leo vel fringilla est. Volutpat diam ut venenatis tellus in. Ut sem viverra aliquet eget sit amet. Dictum at tempor commodo ullamcorper a. Aliquam nulla facilisi cras fermentum odio eu feugiat. Tristique et egestas quis ipsum suspendisse ultrices. Elementum sagittis vitae et leo duis ut. Aliquet risus feugiat in ante. Pretium fusce id velit ut tortor pretium viverra. Dictumst quisque sagittis purus sit amet volutpat consequat mauris nunc. Turpis tincidunt id aliquet risus feugiat in ante metus dictum. Viverra aliquet eget sit amet tellus cras adipiscing. Nisl tincidunt eget nullam non nisi est sit.\nVelit aliquet sagittis id consectetur. Elementum curabitur vitae nunc sed velit. Ante in nibh mauris cursus mattis molestie. Vel elit scelerisque mauris pellentesque. Commodo sed egestas egestas fringilla phasellus faucibus. Rutrum tellus pellentesque eu tincidunt tortor. Nec ullamcorper sit amet risus nullam eget felis eget nunc. At urna condimentum mattis pellentesque. Mi sit amet mauris commodo quis imperdiet. Iaculis eu non diam phasellus vestibulum lorem. Tempus iaculis urna id volutpat lacus laoreet non curabitur. Venenatis lectus magna fringilla urna porttitor rhoncus dolor purus non. At tempor commodo ullamcorper a. Nisl vel pretium lectus quam id leo in vitae. Mauris rhoncus aenean vel elit scelerisque mauris pellentesque pulvinar pellentesque. Ultrices eros in cursus turpis massa. Et tortor consequat id porta nibh venenatis cras sed felis. Amet luctus venenatis lectus magna fringilla urna porttitor. Est sit amet facilisis magna etiam. Lacus vestibulum sed arcu non odio euismod lacinia.\nAmet consectetur adipiscing elit pellentesque habitant morbi tristique senectus. Commodo nulla facilisi nullam vehicula ipsum a arcu cursus. Pretium lectus quam id leo in vitae turpis massa. Proin nibh nisl condimentum id. Dui nunc mattis enim ut tellus elementum. Libero enim sed faucibus turpis in eu mi bibendum. Eu tincidunt tortor aliquam nulla facilisi cras fermentum odio eu. Porttitor eget dolor morbi non. Nulla facilisi cras fermentum odio eu feugiat pretium nibh ipsum. Cum sociis natoque penatibus et magnis. Metus dictum at tempor commodo ullamcorper a. Convallis tellus id interdum velit laoreet id. Mi in nulla posuere sollicitudin aliquam ultrices sagittis orci.\nLacinia quis vel eros donec ac odio tempor orci. Risus nec feugiat in fermentum. Convallis convallis tellus id interdum. Eget velit aliquet sagittis id consectetur purus ut faucibus. Fringilla est ullamcorper eget nulla. Commodo ullamcorper a lacus vestibulum sed arcu non. Nulla aliquet enim tortor at. Malesuada proin libero nunc consequat interdum varius sit amet. Faucibus ornare suspendisse sed nisi lacus. Pharetra et ultrices neque ornare aenean euismod. Et malesuada fames ac turpis egestas maecenas pharetra convallis. Urna molestie at elementum eu facilisis. Morbi tristique senectus et netus et malesuada fames ac. Diam quis enim lobortis scelerisque fermentum dui faucibus in. Luctus accumsan tortor posuere ac ut consequat semper viverra nam. Justo laoreet sit amet cursus sit. Morbi blandit cursus risus at ultrices. Sem fringilla ut morbi tincidunt augue interdum velit. Ultricies leo integer malesuada nunc vel risus commodo viverra. Orci sagittis eu volutpat odio facilisis mauris.\nElit sed vulputate mi sit amet mauris. Risus nullam eget felis eget nunc lobortis mattis aliquam. Consectetur a erat nam at lectus urna. Tincidunt dui ut ornare lectus sit amet est. Neque aliquam vestibulum morbi blandit. Maecenas sed enim ut sem viverra aliquet eget. In massa tempor nec feugiat nisl pretium. Donec adipiscing tristique risus nec feugiat in fermentum posuere. Elit at imperdiet dui accumsan sit amet nulla facilisi morbi. Feugiat vivamus at augue eget. Quam id leo in vitae turpis. Nibh tellus molestie nunc non. Ipsum dolor sit amet consectetur adipiscing. Sit amet consectetur adipiscing elit ut aliquam purus sit.");
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: TextField(
controller: _textEditingController,
selectionControls: Platform.isIOS ? CupertinoTextSelectionControls() : MaterialTextSelectionControls(),
autofocus: true,
textCapitalization: TextCapitalization.sentences,
maxLines: null,
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
scroll-bug.mov
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.13.0-17.0.pre.77, on macOS 13.3.1 22E772610a darwin-arm64, locale en-GB)
• Flutter version 3.13.0-17.0.pre.77 on channel master at /opt/homebrew/Caskroom/flutter/3.0.0/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7de053b2b8 (4 hours ago), 2023-08-07 03:51:33 -0400
• Engine revision eb91441398
• Dart version 3.2.0 (build 3.2.0-41.0.dev)
• DevTools version 2.26.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/joshminton/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio 2.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.12.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• 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.13+0-b1751.21-8125866)
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio 2.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.15+0-b2043.56-8887301)
[✓] Connected device (3 available)
• Pixel 7 (mobile) • 2B171FDH2008K5 • android-arm64 • Android 13 (API 33)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E772610a darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 115.0.5790.114
[✓] Network resources
• All expected network resources are available.
• No issues found!Reacted by Greg Price
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 problemsf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.41Found to occur in 3.41Found to occur in 3.41frameworkflutter/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: solvedIssue is closed as solvedIssue is closed as solvedteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Activity
darshankawar commentedon Aug 8, 2023
Thanks for the report. I was able to replicate the reported behavior. Maybe related to #89024 ?
stable, master flutter doctor -v
joshminton commentedon Aug 8, 2023
Thanks @darshankawar . It might be worth mentioning that on the stable branch, I don't have the issue. However, on stable I do have a different issue with TextFields, which I reported in #131936 not realising it was already fixed in
master. My own workaround for that issue was to wrap the TextField in a SingleChildScrollView, but that resulted in the same behaviour as I've reported here in this issue. So, it appears to me that whatever changes have been made inmasterfixed the behaviour I referenced in #131936 but may have resulted in this issue.13 remaining items
loic-sharma commentedon Apr 30, 2026
Reopening as @Alspb and @saurabh-mirajkar were able to reproduce this issue on 3.41.
1123434219a-lab commentedon Jun 3, 2026
I can consistently reproduce this severe jittering issue on Android with a very minimal setup.
The Root Cause (Viewport Anchor Mismatch)
Through deep debugging, I found the root cause isn't just edge auto-scrolling, but a viewport tracking anchor mismatch inside
RenderEditable/EditableText:showCaretOnScreen()to keep the Extent Handle (Right Cursor) in view.Minimal Reproducible Code
Steps to Reproduce
Type a long multi-line text into the TextField until it triggers vertical scrolling (exceeds 5 lines).
Select all text.
Hold and drag the start selection handle (top-left) upwards.
Result: The whole text area and selection handles start stuttering and shaking violently. When released, the viewport snaps directly to the end of the text selection.
Fix: stop auto-scrolling during selection handle drag (flutter#185206)
github-actions commentedon Oct 9, 2026
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.