From a2e49e21edf93c4895ad25e87ba0a13ec0a781b2 Mon Sep 17 00:00:00 2001 From: Morn Date: Mon, 20 Jan 2025 12:02:25 +0800 Subject: [PATCH 1/2] fix: the cursor constantly blinking on Android --- .../delta_input_on_non_text_update_impl.dart | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart b/lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart index 43ac55d70..237547d9b 100644 --- a/lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart +++ b/lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart @@ -60,15 +60,19 @@ Future onNonTextUpdate( // `onFloatingCursor` event instead. AppFlowyEditorLog.input.debug('[Android] onNonTextUpdate: $nonTextUpdate'); if (selection != null) { - editorState.updateSelectionWithReason( - Selection.collapsed( - Position( - path: selection.start.path, - offset: nonTextUpdate.selection.start, + final nonTextUpdateStart = nonTextUpdate.selection.start; + final selectionStart = selection.start.offset; + if (nonTextUpdateStart != selectionStart) { + editorState.updateSelectionWithReason( + Selection.collapsed( + Position( + path: selection.start.path, + offset: nonTextUpdateStart, + ), ), - ), - reason: SelectionUpdateReason.uiEvent, - ); + reason: SelectionUpdateReason.uiEvent, + ); + } } } else if (PlatformExtension.isIOS) { // on iOS, the cursor movement will trigger the `onFloatingCursor` event. From aeec7164a11f96d5e5266c1cfe7a6d541f1f5232 Mon Sep 17 00:00:00 2001 From: Morn Date: Wed, 22 Jan 2025 11:27:53 +0800 Subject: [PATCH 2/2] fix: RTL languages display incorrectly with soft line break(#7153) --- .../base_component/block_component_configuration.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/editor/block_component/base_component/block_component_configuration.dart b/lib/src/editor/block_component/base_component/block_component_configuration.dart index d2169202e..c581e08b7 100644 --- a/lib/src/editor/block_component/base_component/block_component_configuration.dart +++ b/lib/src/editor/block_component/base_component/block_component_configuration.dart @@ -122,5 +122,5 @@ EdgeInsets _blockSelectionAreaPadding(Node node) { } TextAlign _textAlign(Node node) { - return TextAlign.left; + return TextAlign.start; }