Skip to content

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.

fix: the old context menu didn't dismiss after double-tap the other place

Lucas.Xu2d66dfabe86f
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.dart
index e562db0f7e..cca55527bf 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
@@ -505,6 +505,13 @@ class _AppFlowySelectionState extends State<AppFlowySelection>
}
void _showContextMenu(TapDownDetails details) {
+ _clearContextMenu();
+
+ // For now, only support the text node.
+ if (!currentSelectedNodes.every((element) => element is TextNode)) {
+ return;
+ }
+
final contextMenu = OverlayEntry(
builder: (context) => ContextMenu(
position: details.globalPosition,