mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: The cursor will not disappear after clicking in an area outside the editor.
This commit is contained in:
parent
dd9cac9c1d
commit
42866e1057
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user