File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
frontend/app_flowy/packages
appflowy_editor_plugins/lib/src/emoji_picker Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ class SelectionMenu implements SelectionMenuService {
111111
112112 Overlay .of (context)? .insert (_selectionMenuEntry! );
113113
114- editorState.service.keyboardService? .disable ();
114+ editorState.service.keyboardService? .disable (showCursor : true );
115115 editorState.service.scrollService? .disable ();
116116 selectionService.currentSelection.addListener (_onSelectionChange);
117117 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ abstract class AppFlowyKeyboardService {
3535 /// you can disable the keyboard service of flowy_editor.
3636 /// But you need to call the `enable` function to restore after exiting
3737 /// your custom component, otherwise the keyboard service will fails.
38- void disable ();
38+ void disable ({ bool showCursor = false } );
3939}
4040
4141/// Process keyboard events
@@ -62,6 +62,7 @@ class _AppFlowyKeyboardState extends State<AppFlowyKeyboard>
6262 final FocusNode _focusNode = FocusNode (debugLabel: 'flowy_keyboard_service' );
6363
6464 bool isFocus = true ;
65+ bool showCursor = false ;
6566
6667 @override
6768 List <ShortcutEvent > get shortcutEvents => widget.shortcutEvents;
@@ -101,8 +102,9 @@ class _AppFlowyKeyboardState extends State<AppFlowyKeyboard>
101102 }
102103
103104 @override
104- void disable () {
105+ void disable ({ bool showCursor = false } ) {
105106 isFocus = false ;
107+ this .showCursor = showCursor;
106108 _focusNode.unfocus ();
107109 }
108110
@@ -137,8 +139,10 @@ class _AppFlowyKeyboardState extends State<AppFlowyKeyboard>
137139 void _onFocusChange (bool value) {
138140 Log .keyboard.debug ('on keyboard event focus change $value ' );
139141 isFocus = value;
140- if (! value) {
142+ if (! value && ! showCursor ) {
141143 widget.editorState.service.selectionService.clearCursor ();
144+ } else {
145+ showCursor = false ;
142146 }
143147 }
144148
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
55import 'emoji_picker.dart' ;
66
77SelectionMenuItem emojiMenuItem = SelectionMenuItem (
8- name: () => 'emoji ' ,
8+ name: () => 'Emoji ' ,
99 icon: (editorState, onSelected) => Icon (
1010 Icons .emoji_emotions_outlined,
1111 color: onSelected
You can’t perform that action at this time.
0 commit comments