Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Drag On Long Press does nothing #71

Open
ThomJ130 opened this issue May 7, 2022 · 2 comments
Open

Disabling Drag On Long Press does nothing #71

ThomJ130 opened this issue May 7, 2022 · 2 comments

Comments

@ThomJ130
Copy link

ThomJ130 commented May 7, 2022

For DragAndDropLists, having the parameter itemDragOnLongPress set to false does nothing.

Looking at the source code under drag_and_drop_lists.dart, you can search for itemDragOnLongPress and see that it is only initialized, never used.

image

Can this be fixed? Is there a work-around? I need dragging behavior to be immediate.

@Pablo-Aldana
Copy link

Pablo-Aldana commented Aug 24, 2022

I have found a "workaround" if you setup listDragOnLongPress=true it will make the magic, but of course would make also the list draggable instead of longPress.

There is another trick you can create a dragHandle with empty container to make just the item draggable

itemDragHandle: const DragHandle(
        child:Container(),
      ),

I did a quick research and the problem seems to be on DragAndDropBuilderParameters class that only has one parameter for this this.dragOnLongPress = true and it is setup by dragOnLongPress: widget.listDragOnLongPress, so it is the list the one setting up this value.

@Durai-Bharath
Copy link

To make the dragging behavior to be immediate
Go to C:...\AppData\Local\Pub\Cache\hosted\pub.dev\drag_and_drop_lists-0.4.0\lib\drag_and_drop_builder_parameters.dart
and change the contructor value of this.dragOnLongPress to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants