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: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36Found to occur in 3.36has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyplatform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Steps to reproduce
Watch video demonstration.
Expected results
.
Actual results
.
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(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
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> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(child: TextField(maxLines: null)),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Screen_recording_20250829_171051.mp4
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Flutter 3.35.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 05db968908 (4 days ago) • 2025-08-25 10:21:35 -0700
Engine • hash abb725c9a5211af2a862b83f74b7eaf2652db083 (revision a8bfdfc394) (6 days ago) • 2025-08-22 23:51:12.000Z
Tools • Dart 3.9.0 • DevTools 2.48.0Reacted by Stefan Roth
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36Found to occur in 3.36has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyplatform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Activity
darshankawar commentedon Aug 29, 2025
I was able to replicate the reported behavior. The issue is, for multiline textfield, selecting the text in first line also highlights the trailing whitespace in accordance to next line's length, as shown below:
While if we try to select the next line's text if length of it is less than first line, it doesn't highlight the trailing whitespace:
Above behavior occurs Android, iOS and desktop if we pass a value to
maxLinesor also addingminLines, but not in web, wherein, it doesn't highlight the trailing whitespace of first line:I checked the native behavior on Android and iOS using Samsung / Notes app and there, it doesn't highlight the whitespace:
I tried to find if this is an existing issue filed already but couldn't find an obvious / similar issue or if I missed to find it if already present.
Based on my findings above, keeping the issue open for team's tracking.
[-]TextSelection Error[/-][+]App highlights / selects trailing whitespaces in a multi-line textfield.[/+]loic-sharma commentedon Sep 18, 2025
cc @LongCatIsLooong
anazr9 commentedon Apr 18, 2026
Opened PR: #185239
justinmc commentedon Apr 21, 2026
CC @Renzo-Olivares from triage.
I'm curious about how this behaves on all of our platforms.
Fix multiline EditableText selection highlighting width (flutter#185239)
github-actions commentedon Oct 23, 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.Fix multiline EditableText selection highlighting width (flutter#185239)