Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#8459 closed bug (fixed)

Draggable: element can snap to an element that was removed during drag

Reported by: jmelis Owned by:
Priority: minor Milestone: 1.10.3
Component: ui.draggable Version: 1.8.22
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

didn't found any related discussion on the trac, nor in web search.

The issue is :

if you remove an element "snappable" during a drag (with ui.draggable), it is still possible to snap to it, even if it has gone away. if you drop, then drag again, it's ok because the element was removed BEFORE the drag init.

Expected behavior :

as the element is not there anymore, we should not be able to snap to its old place.

What happens ?

I know nothing about UI source code but I guess calculations for snapping are made before the 'start' event is fired ; so if we remove the snapping element in this callback, it's too late ! ...and of course I'm not telling about if we try to remove elements while dragging.

Reproducible : always Way to reproduce : http://jsfiddle.net/jmelis/vk3Xh/

More information on my environment :

  • Firefox 10.0.5
  • Linux 3.3.8/64bits on KDE 4.8.3
  • jQuery 1.7.2, UI 1.8.21 (issue reproduce with 1.8.18 inside jsfiddle)
  • I've also tried new UI version 1.8.22 => same issue

Btw, I'm pretty sure that the environment doesn't balance in here.

Change History (7)

comment:1 Changed 10 years ago by Scott González

Milestone: 1.9.02.0.0

comment:2 Changed 10 years ago by mikesherov

Status: newopen
Summary: draggable can snap a removed elementdraggable: element can snap to an element that was removed during drag

comment:3 Changed 10 years ago by mikesherov

Summary: draggable: element can snap to an element that was removed during dragDraggable: element can snap to an element that was removed during drag

comment:4 Changed 10 years ago by Mike Sherov

Resolution: fixed
Status: openclosed

Draggable: make sure snap elements are in the document before snapping. Fixes #8459 - Draggable: element can snap to an element that was removed during drag.

Changeset: 9d8af804ad4cebe434d420b29467c596809a7cca

comment:5 Changed 10 years ago by mikesherov

Milestone: 2.0.01.11.0

comment:6 Changed 10 years ago by Mike Sherov

Draggable: make sure snap elements are in the document before snapping. Fixes #8459 - Draggable: element can snap to an element that was removed during drag.(cherry picked from commit 9d8af804ad4cebe434d420b29467c596809a7cca)

Changeset: ecabe4754412b61059d429040e266ca921a754b2

comment:7 Changed 10 years ago by Scott González

Milestone: 1.11.01.10.3
Note: See TracTickets for help on using tickets.