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.

chore: ignore dragtarget event when performing insert animation

appflowye42bfe0b1eed
diff --git a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart
index b0f511f641..63bd9638b4 100644
--- a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart
+++ b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart
@@ -82,6 +82,8 @@ class ReorderFlex extends StatefulWidget {
final ReorderDragTargetIndexKeyStorage? dragTargetIndexKeyStorage;
+ final bool reorderable;
+
ReorderFlex({
Key? key,
this.scrollController,
@@ -89,6 +91,7 @@ class ReorderFlex extends StatefulWidget {
required this.children,
required this.config,
required this.onReorder,
+ this.reorderable = true,
this.dragStateStorage,
this.dragTargetIndexKeyStorage,
this.onDragStarted,
@@ -385,7 +388,7 @@ class ReorderFlexState extends State<ReorderFlex>
},
onWillAccept: (FlexDragTargetData dragTargetData) {
// Do not receive any events if the Insert item is animating.
- if (_animation.deleteController.isAnimating) {
+ if (_animation.insertController.isAnimating) {
return false;
}
@@ -421,6 +424,7 @@ class ReorderFlexState extends State<ReorderFlex>
deleteAnimationController: _animation.deleteController,
draggableTargetBuilder: widget.interceptor?.draggableTargetBuilder,
useMoveAnimation: widget.config.useMoveAnimation,
+ draggable: widget.reorderable,
child: child,
);
}