-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] cannot input anything when start a new line #66
Comments
Likely related to AppFlowy-IO/AppFlowy#1756 |
in file InputSearvice.dart, I added a log to see what is the difference between English and Chinese when start a new line.
you can see that the Selection's TextRange start and end index |
annieappflowy
added
bug
Something isn't working
editor
features related to the rich-text editor
labels
Apr 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
On windows platform,input Chinese using Sougou IME,I can input only one line sentences,when I start a new line,I cannot input anny thing. At this time, I can see the error show in the Android Studio logs:
======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for ValueNotifier<Selection?>:
Range end 7 is out of text of length 1
'package:flutter/src/services/text_input.dart':
Failed assertion: line 973 pos 12: 'range.end >= 0 && range.end <= 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.md
When the exception was thrown, this was the stack:
#2 TextEditingValue._textRangeIsValid (package:flutter/src/services/text_input.dart:973:12)
#3 TextEditingValue.toJSON (package:flutter/src/services/text_input.dart:927:12)
#4 _PlatformTextInputControl.setEditingState (package:flutter/src/services/text_input.dart:2267:13)
#5 TextInput._setEditingState (package:flutter/src/services/text_input.dart:1955:15)
#6 TextInputConnection.setEditingState (package:flutter/src/services/text_input.dart:1361:25)
#7 _AppFlowyInputState.attach (package:appflowy_editor/src/service/input_service.dart:120:9)
#8 _AppFlowyInputState._onSelectionChange (package:appflowy_editor/src/service/input_service.dart:286:7)
#9 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:381:24)
#10 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:495:5)
#11 _AppFlowySelectionState.updateSelection (package:appflowy_editor/src/service/selection_service.dart:236:22)
#12 EditorState.updateCursorSelection (package:appflowy_editor/src/editor_state.dart:111:32)
#13 EditorState.apply. (package:appflowy_editor/src/editor_state.dart:158:15)
#14 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289:15)
#15 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#16 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1076:5)
#17 _invoke (dart:ui/hooks.dart:145:13)
#18 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#19 _drawFrame (dart:ui/hooks.dart:112:31)
(elided 2 frames from class _AssertionError)
The ValueNotifier<Selection?> sending notification was: ValueNotifier<Selection?>#40104(start = path = [14], offset = 0, end = path = [14], offset = 0)
flutter: [DEBUG][editor]: 2023-04-13 14:36:06.236681: Seal history item
flutter: [DEBUG][input]: 2023-04-13 14:36:07.152556: (TextEditingDeltaNonTextUpdate#ce5a1(oldText:
flutter: 中文输入第一行
flutter: , selection: TextSelection.collapsed(offset: 7, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: 7, end: 7)))
flutter: [DEBUG][input]: 2023-04-13 14:36:07.152556: (TextEditingDeltaInsertion#4f401(oldText:
flutter: 中文输入第一行
flutter: , textInserted: 中文输入法, insertionOffset: 7, selection: TextSelection.collapsed(offset: 12, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: 7, end: 12)))
flutter: [DEBUG][input]: 2023-04-13 14:36:07.158540: (TextEditingDeltaNonTextUpdate#06122(oldText:
flutter: 中文输入第一行中文输入法
flutter: , selection: TextSelection.collapsed(offset: 12, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1)))
flutter: [DEBUG][input]: 2023-04-13 14:36:08.531108: (TextEditingDeltaNonTextUpdate#ffc92(oldText:
flutter: 中文输入第一行中文输入法
flutter: , selection: TextSelection.collapsed(offset: 12, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: 12, end: 12)))
flutter: [DEBUG][input]: 2023-04-13 14:36:08.532104: (TextEditingDeltaInsertion#7943c(oldText:
flutter: 中文输入第一行中文输入法
flutter: , textInserted: 阿达撒发生的就分手, insertionOffset: 12, selection: TextSelection.collapsed(offset: 21, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: 12, end: 21)))
flutter: [DEBUG][input]: 2023-04-13 14:36:08.537091: (TextEditingDeltaNonTextUpdate#02319(oldText:
flutter: 中文输入第一行中文输入法阿达撒发生的就分手
flutter: , selection: TextSelection.collapsed(offset: 21, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1)))
======== Exception caught by services library ======================================================
The following StateError was thrown during method call TextInputClient.updateEditingStateWithDeltas:
Bad state: No element
When the exception was thrown, this was the stack:
#0 Iterable.first (dart:core/iterable.dart:624:7)
#1 TextTransaction.insertText (package:appflowy
How to Reproduce
Expected Behavior
can input when change line
Operating System
Windows
AppFlowy Editor Version(s)
0.1.6
Screenshots
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: