apache / apache/royale-asjs

Drag and Drop [preventDefault issue]

Open
#1,114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
ActionScript
Stars
380
Forks
120
PR merge metrics
No merged PRs in 30d

Description

I'm using DragMouseController and DropMouseController to implement drag and drop on my project.

That works fine, the problem occurs when I drop an item out of the destination container, the object just "disappears".

I have thought of putting a drop handler at the level of the main form and somehow "cancel" the drop.

There is a "preventDefault" function, but it raises exception when I call it.
What am I doing wrong?

My code:
_DraggableItem.mxml_
```











```

_preventDefault on my MainContent.mxml:_
```
private function onDragEnd(event:DragEvent):void
{
event.preventDefault();
}

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the drag outside the destination using DraggableItem.mxml and MainContent.mxml, then read the DragMouseController and DropMouseController usage shown in the issue. Trace the dragDrop event and the preventDefault call, and confirm the behavior to consider the issue done: canceling the drop should not make the dragged object disappear or raise an exception.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.