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: selection areas could not overlay

Lucas.Xu29fe4811c347
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/selection/flowy_selection_widget.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/selection/selection_widget.dart
similarity index 76%
rename from frontend/app_flowy/packages/flowy_editor/lib/render/selection/flowy_selection_widget.dart
rename to frontend/app_flowy/packages/flowy_editor/lib/render/selection/selection_widget.dart
index 96dd6a7759..e3dea7af34 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/selection/flowy_selection_widget.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/selection/selection_widget.dart
@@ -25,8 +25,12 @@ class _SelectionWidgetState extends State<SelectionWidget> {
link: widget.layerLink,
offset: widget.rect.topLeft,
showWhenUnlinked: true,
- child: Container(
- color: widget.color,
+ // Ignore the gestures in selection overlays
+ // to solve the problem that selection areas cannot overlap.
+ child: IgnorePointer(
+ child: Container(
+ color: widget.color,
+ ),
),
),
);
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/service/selection_service.dart b/frontend/app_flowy/packages/flowy_editor/lib/service/selection_service.dart
index 975677d508..375ebee31c 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/service/selection_service.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/service/selection_service.dart
@@ -5,7 +5,7 @@ import 'package:flowy_editor/document/position.dart';
import 'package:flowy_editor/document/selection.dart';
import 'package:flowy_editor/render/selection/selectable.dart';
import 'package:flowy_editor/render/selection/cursor_widget.dart';
-import 'package:flowy_editor/render/selection/flowy_selection_widget.dart';
+import 'package:flowy_editor/render/selection/selection_widget.dart';
import 'package:flowy_editor/extensions/object_extensions.dart';
import 'package:flowy_editor/extensions/node_extensions.dart';
import 'package:flutter/gestures.dart';