Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: The cursor will not disappear after clicking in an area outside the editor.
Lucas.Xu42866e105702
diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dartindex 1867574993..dee3f42725 100644--- a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart+++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart@@ -129,6 +129,10 @@ class _AppFlowyKeyboardState extends State<AppFlowyKeyboard>void _onFocusChange(bool value) {Log.keyboard.debug('on keyboard event focus change $value');+ isFocus = value;+ if (!value) {+ widget.editorState.service.selectionService.clearCursor();+ }}KeyEventResult _onKey(FocusNode node, RawKeyEvent event) {diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dartindex c5e351059c..6f6897596f 100644--- a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart+++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart@@ -57,6 +57,9 @@ abstract class AppFlowySelectionService {/// Clears the selection area, cursor area and the popup list area.void clearSelection();+ /// Clears the cursor area.+ void clearCursor();+/// Returns the [Node]s in [Selection].List<Node> getNodesInSelection(Selection selection);@@ -205,16 +208,23 @@ class _AppFlowySelectionState extends State<AppFlowySelection>currentSelectedNodes = [];currentSelection.value = null;+ clearCursor();// clear selection areas_selectionAreas..forEach((overlay) => overlay.remove())..clear();// clear cursor areas++ // hide toolbar+ editorState.service.toolbarService?.hide();+ }++ @override+ void clearCursor() {+ // clear cursor areas_cursorAreas..forEach((overlay) => overlay.remove())..clear();- // hide toolbar- editorState.service.toolbarService?.hide();}@override