Repository navigation
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: 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 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
- Run the application in Chrome.
- Use a French AZERTY keyboard.
- Focus the TextField.
- Press the dead key ^.
- Press A (expected character: Â).
Expected results
The dead key composition should complete normally.
Since  is not allowed by the formatter in this example, the resulting character may be rejected, but Flutter should remain in a valid editing state and no assertion should be thrown.
Actual results
Flutter throws an assertion similar to:
══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════
Assertion failed:
range.end >= 0 && range.end <= text.length
"Range end 5 is out of text of length 4"
Afterwards, text editing behaves incorrectly (cursor movement, other text fields, editing state).
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox(
width: 300,
child: TextField(
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r"[A-Z]"),
),
],
),
),
),
),
);
}
}Screenshots or Video
dead-key-error.mp4
Logs
Logs
══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞═══════════════════════
The following assertion was thrown during method call
TextInputClient.updateEditingState:
Assertion failed:
file:///opt/flutter/packages/flutter/lib/src/services/text_input.dart:1182:7
range.end >= 0 && range.end <= text.length
"Range end 4 is out of text of length 3"
When the exception was thrown, this was the stack
call:
MethodCall(TextInputClient.updateEditingState, [1, {text: AAA,
selectionBase: 3, selectionExtent: 3, composingBase: 3,
composingExtent: 4}])
═════════════════════════════════════════════════════════════════Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.38.7, on macOS 26.5.1 25F80 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.3)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: 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 onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
mbcorona commentedon Jul 7, 2026
Hi @Azramis , Thanks for the detailed repro. Routing to the text input team.
Azramis commentedon Jul 7, 2026
Hi @mbcorona , no problem !
Not sure if the issue came from text input, or if it's
FilteringTextInputFormatterthe culprit...Good luck Text Input Team fixing it 🤞
3 remaining items
flutter-triage-bot commentedon Aug 9, 2026
This issue is missing a priority label. Please set a priority label when adding the
triaged-weblabel.[web] Drop stale composing range after text is replaced mid-compositi…
github-actions commentedon Oct 28, 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.[web] Drop stale composing range after text is replaced mid-compositi…