1

i have a dragtarget and multiple draggables. I was able to successfully drop the draggable to the dragtarget. But when a new draggable hovers over the placed dragtarget it removes the already placed on the dragtarget?.I've tried using ignorepointer. im not getting the desired output.

enter image description here

                            onWillAccept: (data) {
                              return data ==
                                  controller.options[controller
                                      .selectedAnserIndex]; // assigning data
                            },
                            onAccept: (data) {
                              controller.updateDropped(
                                  controller.isDropped); // updating a bool to fix the drag target
                              controller.updateIndexOfBlank(index);
                            },
                            onLeave: (data) {
                              controller.updateDropped(false); // on leave making it make it false
                            },
1
  • I don’t know what functionality you want to achieve, but you could check wether the DragTarget is already occupied inside it’s onWillAccept method and if it is you just return false. This should prevent it from changing on hover. Commented Jul 12, 2023 at 9:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.