Ticket #4752 (closed bug: fixed)

Opened 5 years ago

Last modified 3 years ago

link event firing on sortable with connect list

Reported by: rambat Owned by:
Priority: minor Milestone: 1.8.7
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

If you have 2 sortable lists populated with links inside the unordered list elements dropping the element onto a connected list fires the click event.

Dropping on the same list does not fire the event.

Tested with 1.7.2.

You can duplicate this error by injecting a link into a list item on the demo page ( http://jqueryui.com/demos/sortable/#connect-lists)

Then drag that item into the connected list.

Change History

comment:1 Changed 4 years ago by joern.zaefferer

  • Milestone changed from TBD to 1.8

See also #4845.

comment:2 Changed 4 years ago by jessicah

I just discovered this today as well, definitely a connectWith issue.

Haven't had it happen in IE8 yet, happens in Chrome and Firefox mostly consistently; occasionally it doesn't fire the link.

comment:3 Changed 4 years ago by awgy

I ran into this issue as well. The click event isn't being prevented when the sorted item moves to a connected sortable. If the sorted item remains in its original list, the click event is properly prevented.

I tracked this down to the _preventClickEvent property used by ui.mouse. It's set to true in _mouseUp(), but it's set for the original container-- which is fine, unless the container changed (which is the case when the item moves to a connected sortable). I've pushed a patch to a GitHub fork that changes the click event prevention to be tied to the event target, not the container.

 See GitHub fork commit

comment:4 Changed 4 years ago by awgy

Correction: Please use the following GitHub commit link:

 GitHub commit 15d1a0d

comment:5 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in  e2a693b.

comment:6 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.7
Note: See TracTickets for help on using tickets.