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: toolbar menu not showing beacase keyboard height is not updated in time (#7060)
Morn5ffa27f54560
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dartindex cd806f6c56..787ccfda9f 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart@@ -20,6 +20,7 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';abstract class AppFlowyMobileToolbarWidgetService {void closeItemMenu();+void closeKeyboard();PropertyValueNotifier<bool> get showMenuNotifier;@@ -179,7 +180,13 @@ class _MobileToolbarState extends State<_MobileToolbar>// but in this case, we don't want to update the cached keyboard height.// This is because we want to keep the same height when the menu is shown.bool canUpdateCachedKeyboardHeight = true;- ValueNotifier<double> cachedKeyboardHeight = ValueNotifier(0.0);++ /// when the [_MobileToolbar] disposed before the keyboard height can be updated in time,+ /// there will be an issue with the height being 0+ /// this is used to globally record the height.+ static double _globalCachedKeyboardHeight = 0.0;+ ValueNotifier<double> cachedKeyboardHeight =+ ValueNotifier(_globalCachedKeyboardHeight);// used to check if click the same item againint? selectedMenuIndex;@@ -408,6 +415,9 @@ class _MobileToolbarState extends State<_MobileToolbar>);}}+ if (keyboardHeight > 0) {+ _globalCachedKeyboardHeight = keyboardHeight;+ }return SizedBox(height: keyboardHeight,child: (showingMenu && selectedMenuIndex != null)