diff --git a/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart b/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart index d88625bc6..57e3d5b15 100644 --- a/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart +++ b/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart @@ -188,8 +188,10 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient { start: composingTextRange!.start, end: delta.composing.end, ); + return; } else { composingTextRange = delta.composing; + return; } } @@ -198,12 +200,11 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient { PlatformExtension.isMacOS) && delta is TextEditingDeltaNonTextUpdate) { composingTextRange = delta.composing; + return; } // solve the issue where the Chinese IME doesn't continue deleting after the input content has been deleted. - if (composingTextRange?.isCollapsed ?? false) { - composingTextRange = TextRange.empty; - } + composingTextRange = TextRange.empty; } } diff --git a/lib/src/editor/editor_component/service/keyboard_service_widget.dart b/lib/src/editor/editor_component/service/keyboard_service_widget.dart index cee1f71f3..aef9bdf59 100644 --- a/lib/src/editor/editor_component/service/keyboard_service_widget.dart +++ b/lib/src/editor/editor_component/service/keyboard_service_widget.dart @@ -164,7 +164,7 @@ class KeyboardServiceWidgetState extends State /// handle hardware keyboard KeyEventResult _onKeyEvent(FocusNode node, KeyEvent event) { if ((event is! KeyDownEvent && event is! KeyRepeatEvent) || - !enableShortcuts) { + (!enableShortcuts && !backspaceCommand.canRespondToRawKeyEvent(event))) { if (textInputService.composingTextRange != TextRange.empty) { return KeyEventResult.skipRemainingHandlers; }