Skip to content

Commit

Permalink
fix: the cursor constantly blinking on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
asjqkkkk committed Jan 20, 2025
1 parent 2a03498 commit a2e49e2
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,19 @@ Future<void> 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,

Check warning on line 69 in lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/editor/editor_component/service/ime/delta_input_on_non_text_update_impl.dart#L63-L69

Added lines #L63 - L69 were not covered by tests
offset: nonTextUpdateStart,
),
),
),
reason: SelectionUpdateReason.uiEvent,
);
reason: SelectionUpdateReason.uiEvent,
);
}
}
} else if (PlatformExtension.isIOS) {
// on iOS, the cursor movement will trigger the `onFloatingCursor` event.
Expand Down

0 comments on commit a2e49e2

Please sign in to comment.