소스 검색

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

Lucas.Xu 2 년 전
부모
커밋
2d66dfabe8
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart

+ 7 - 0
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,