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 problemsc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.16Found to occur in 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17Found to occur in 3.17frameworkflutter/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 onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages 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
Steps to reproduce the issue.
- flutter create example
- replace 'Text' widget to 'TextField'
- type letters, arrow keys at the same time in 'TextField'
Tested Enviroments
Tested Enviroments
- device type : M1 MacBook Pro
- macOS version : Sonoma 14.1.1
Logs
Logs
════════ Exception caught by services library ══════════════════════════════════
The following assertion was thrown during method call TextInputClient.performSelectors:
Range start 41 is out of text of length 40
'package:flutter/src/services/text_input.dart':
Failed assertion: line 960 pos 12: 'range.start >= 0 && range.start <= text.length'
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
When the exception was thrown, this was the stack:
#2 TextEditingValue._textRangeIsValid (package:flutter/src/services/text_input.dart:960:12)
#3 TextEditingValue.toJSON (package:flutter/src/services/text_input.dart:915:12)
#4 _PlatformTextInputControl.setEditingState (package:flutter/src/services/text_input.dart:2262:13)
#5 TextInput._setEditingState (package:flutter/src/services/text_input.dart:1951:15)
#6 TextInputConnection.setEditingState (package:flutter/src/services/text_input.dart:1375:25)
#7 EditableTextState._updateRemoteEditingValueIfNeeded (package:flutter/src/widgets/editable_text.dart:3304:27)
#8 EditableTextState.endBatchEdit (package:flutter/src/widgets/editable_text.dart:3293:5)
#9 EditableTextState._formatAndSetValue (package:flutter/src/widgets/editable_text.dart:3844:5)
#10 EditableTextState.userUpdateTextEditingValue (package:flutter/src/widgets/editable_text.dart:4179:5)
#11 EditableTextState._updateSelection (package:flutter/src/widgets/editable_text.dart:4665:5)
#12 CallbackAction.invoke (package:flutter/src/widgets/actions.dart:597:39)
#13 Action._invoke (package:flutter/src/widgets/actions.dart:338:17)
#14 ActionDispatcher.invokeAction (package:flutter/src/widgets/actions.dart:641:19)
#15 Actions.invoke.<anonymous closure> (package:flutter/src/widgets/actions.dart:963:48)
#16 Actions._visitActionsAncestors (package:flutter/src/widgets/actions.dart:745:18)
#17 Actions.invoke (package:flutter/src/widgets/actions.dart:957:30)
#18 _UpdateTextSelectionVerticallyAction.invoke (package:flutter/src/widgets/editable_text.dart:5565:13)
#19 _OverridableContextAction.invokeDefaultAction (package:flutter/src/widgets/actions.dart:1811:28)
#20 _OverridableActionMixin.invoke (package:flutter/src/widgets/actions.dart:1676:9)
#21 Action._invoke (package:flutter/src/widgets/actions.dart:336:19)
#22 ActionDispatcher.invokeAction (package:flutter/src/widgets/actions.dart:641:19)
#23 Actions.invoke.<anonymous closure> (package:flutter/src/widgets/actions.dart:963:48)
#24 Actions._visitActionsAncestors (package:flutter/src/widgets/actions.dart:745:18)
#25 Actions.invoke (package:flutter/src/widgets/actions.dart:957:30)
#26 EditableTextState.performSelector (package:flutter/src/widgets/editable_text.dart:4347:17)
#27 ListBase.forEach (dart:collection/list.dart:51:13)
#28 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1880:19)
#29 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1759:20)
#30 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:559:55)
#31 MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:552:34)
#32 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:567:35)
#33 _invoke2 (dart:ui/hooks.dart:344:13)
#34 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
#35 _Channel.push (dart:ui/channel_buffers.dart:135:31)
#36 ChannelBuffers.push (dart:ui/channel_buffers.dart:343:17)
#37 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:722:22)
#38 _dispatchPlatformMessage (dart:ui/hooks.dart:257:31)
(elided 2 frames from class _AssertionError)
call: MethodCall(TextInputClient.performSelectors, [1, [moveDown:]])
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by services library ══════════════════════════════════
Range start 48 is out of text of length 47
'package:flutter/src/services/text_input.dart':
Failed assertion: line 960 pos 12: 'range.start >= 0 && range.start <= text.length'
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by services library ══════════════════════════════════
Range start 68 is out of text of length 67
'package:flutter/src/services/text_input.dart':
Failed assertion: line 960 pos 12: 'range.start >= 0 && range.start <= text.length'
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by services library ══════════════════════════════════
Range start 71 is out of text of length 70
'package:flutter/src/services/text_input.dart':
Failed assertion: line 960 pos 12: 'range.start >= 0 && range.start <= text.length'
════════════════════════════════════════════════════════════════════════════════Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.1, on macOS 14.1.1 23B81 darwin-arm64, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
[✓] VS Code (version 1.84.2)
[✓] Connected device (2 available)
! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated
with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• No issues found!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 problemsc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.16Found to occur in 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17Found to occur in 3.17frameworkflutter/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 onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
huycozy commentedon Nov 29, 2023
Thanks for the report. I also can reproduce this on macOS and Android platforms whilst it doesn't occur on Web.
Looking at the stack trace, a part of it is similar to #139201.
Reproduced this on the latest stable and master channel. It also appears on the previous release 3.13.9.
Exception log
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.16.1, on macOS 14.1 23B74 darwin-x64, locale en-VN) • Flutter version 3.16.1 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 7f20e5d18c (9 hours ago), 2023-11-27 09:47:30 -0800 • Engine revision 22b600f240 • Dart version 3.2.1 • DevTools version 2.28.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.13.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (version unknown) • Android Studio at /Applications/Android Studio Preview.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 ✗ Unable to determine Android Studio version. • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.22-10799086) [✓] Android Studio (version 2022.3) • Android Studio at /Applications/Android Studio Giraffe Patch 3.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 17.0.6+0-17.0.6b829.9-10027231) [✓] Android Studio (version 2022.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 • android-studio-dir = /Applications/Android Studio.app/ • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.84.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.76.0 [✓] Connected device (3 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 119.0.6045.159 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category.[-][macOS][Desktop]: Crashes when inputting letters and arrow keys at the same time in "TextField"[/-][+]Crashes when inputting letters and arrow keys at the same time in `TextField`[/+]Fix 139196 selection OOB (#140300)
github-actions commentedon Jan 17, 2024
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.