File tree Expand file tree Collapse file tree 2 files changed +37
-12
lines changed
frontend/app_flowy/packages/appflowy_board/lib/src/widgets Expand file tree Collapse file tree 2 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,31 @@ class IgnorePointerWidget extends StatelessWidget {
277277 }
278278}
279279
280+ class AbsorbPointerWidget extends StatelessWidget {
281+ final Widget ? child;
282+ final bool useIntrinsicSize;
283+ const AbsorbPointerWidget ({
284+ required this .child,
285+ this .useIntrinsicSize = false ,
286+ Key ? key,
287+ }) : super (key: key);
288+
289+ @override
290+ Widget build (BuildContext context) {
291+ final sizedChild = useIntrinsicSize
292+ ? child
293+ : SizedBox (width: 0.0 , height: 0.0 , child: child);
294+
295+ final opacity = useIntrinsicSize ? 0.3 : 0.0 ;
296+ return AbsorbPointer (
297+ child: Opacity (
298+ opacity: opacity,
299+ child: sizedChild,
300+ ),
301+ );
302+ }
303+ }
304+
280305class PhantomWidget extends StatelessWidget {
281306 final Widget ? child;
282307 final double opacity;
@@ -442,15 +467,15 @@ class _FakeDragTargetState<T extends DragTargetData>
442467 return SizeTransitionWithIntrinsicSize (
443468 sizeFactor: widget.deleteAnimationController,
444469 axis: Axis .vertical,
445- child: IgnorePointerWidget (
470+ child: AbsorbPointerWidget (
446471 child: widget.child,
447472 ),
448473 );
449474 } else {
450475 return SizeTransitionWithIntrinsicSize (
451476 sizeFactor: widget.insertAnimationController,
452477 axis: Axis .vertical,
453- child: IgnorePointerWidget (
478+ child: AbsorbPointerWidget (
454479 useIntrinsicSize: true ,
455480 child: widget.child,
456481 ),
Original file line number Diff line number Diff line change @@ -204,16 +204,16 @@ class BoardPhantomController extends OverlapDragTargetDelegate
204204
205205 @override
206206 int canMoveTo (String dragTargetId) {
207- // if (columnsState.isDragging(dragTargetId)) {
208- // return -1;
209- // }
210-
211- // final controller = delegate.controller(dragTargetId);
212- // if (controller != null) {
213- // return controller.columnData.items.length;
214- // } else {
215- // return 0;
216- // }
207+ if (columnsState.isDragging (dragTargetId)) {
208+ return - 1 ;
209+ }
210+
211+ final controller = delegate.controller (dragTargetId);
212+ if (controller != null ) {
213+ return controller.columnData.items.length;
214+ } else {
215+ return 0 ;
216+ }
217217
218218 if (delegate.controller (dragTargetId)? .columnData.items.isEmpty ?? false ) {
219219 return 0 ;
You can’t perform that action at this time.
0 commit comments