-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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 problemsfound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30fyi-text-inputFor the attention of Text Input teamFor the attention of Text Input teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Steps to reproduce
On mobile Chrome or Safari, when tapping text in a TextField (with the maxLines property set to null and containing multiple lines of content), the screen jumps to the end of the text (on mobile Chrome) or to the middle of the text (on mobile Safari).
- Open the DartPad page on mobile Chrome or Safari. (Use of the soft keyboard is required)
- Run the code sample.
- Scroll to the end of the content.
- Tap the screen to activate the soft keyboard.
- Scroll up slightly, then tap the screen again.
- The screen moves to the end or middle of the content, not the place where you tapped.
Expected results
When tapping the TextField, the cursor should move to the tapped location.
Actual results
When tapping the TextField, the screen jumps to a completely different location.
Code sample
Code sample
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(home: const MyHomePage());
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
final _initialText = List.generate(
500,
(int index) => '${index + 1} abcdefg hijklmnop qrs tuv',
).join('\n');
class _MyHomePageState extends State<MyHomePage> {
final _controller = TextEditingController(text: _initialText);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('TextField Bug on Web')),
body: TextField(controller: _controller, maxLines: null),
);
}
}
Screenshots or Video
Recording_2025-02-19-21-05-18.mp4
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.2 24C101 darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.97.1)
[✓] Connected device (3 available)
[✓] Network resources
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 problemsfound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30fyi-text-inputFor the attention of Text Input teamFor the attention of Text Input teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team