Skip to content

Commit

Permalink
fix: mobile toolbar menu auto close on some devices (#941)
Browse files Browse the repository at this point in the history
* Fixed menu closing on some devices

* chore: format code

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
  • Loading branch information
g-apparence and LucasXu0 authored Dec 11, 2024
1 parent 8d3f5b9 commit e6971c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/editor/toolbar/mobile/mobile_toolbar_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class _MobileToolbarV2State extends State<MobileToolbarV2> {
true) {
return const SizedBox.shrink();
}

return RepaintBoundary(
child: MobileToolbarTheme(
backgroundColor: widget.backgroundColor,
Expand Down Expand Up @@ -270,6 +269,7 @@ class _MobileToolbarState extends State<_MobileToolbar>
// if the keyboard is not closed initiative, we need to close the menu at same time
if (!closeKeyboardInitiative &&
cachedKeyboardHeight.value != 0 &&
!showMenuNotifier.value &&
height == 0) {
widget.editorState.selection = null;
}
Expand Down Expand Up @@ -340,8 +340,8 @@ class _MobileToolbarState extends State<_MobileToolbar>
} else {
canUpdateCachedKeyboardHeight = false;
selectedMenuIndex = index;
showItemMenu();
closeKeyboardInitiative = true;
showItemMenu();
_closeKeyboard();
}
},
Expand Down

0 comments on commit e6971c2

Please sign in to comment.