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

Removing the draggable element during the drop event causes the DragStopEvent to fail #34

Open
GoogleCodeExporter opened this issue Dec 7, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

If within a drop event handlers, we remove the draggable from the DOM, a 
NullPointerException occurs when we fire the DragStop event

java.lang.NullPointerException: null
    at gwtquery.plugins.draggable.client.events.DragContext.init(DragContext.java:104)
    at gwtquery.plugins.draggable.client.events.DragContext.<init>(DragContext.java:48)
    at gwtquery.plugins.draggable.client.events.AbstractDraggableEvent.<init>(AbstractDraggableEvent.java:41)
    at gwtquery.plugins.draggable.client.events.DragStopEvent.<init>(DragStopEvent.java:37)
    at gwtquery.plugins.draggable.client.Draggable$3.execute(Draggable.java:490)

Workaround :

Wrap your code removing the draggable from the dom inside and deferred command :

Scheduler.get().scheduleDeferred(new ScheduledCommand() {

      public void execute() {
          //remove your draggable element here

      }
});

Original issue reported on code.google.com by [email protected] on 3 Apr 2012 at 8:38

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

No branches or pull requests

1 participant