Opened 4 years ago

Last modified 4 years ago

#11032 new bug

Sortable "over" event not firing on nested lists

Reported by: Swigle Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:


I'm in the process of creating a somewhat complicated configuration screen to assign users to different lists, dynamically creating groups of users and saving this configuration. For this purpose i'm using multiple sortables, linked by "connectWith". For groups i dynamically create sub lists (ul in a li) wich is also a sortable.

When using a nested sortable, it's possible to drop an item from a connected sortable in the nested sortable, without triggering it's "over" event. (i use this over event to check if the dragged element is allowed there. If not a cancel event is fired).

I've created a (stripped down) JSFiddle as example. There are 2 lists, one with a nested list. If you (gently) try to drag an element from the right list to the top of the left nested list (so as the first item) you can see in the console that sometimes either no "over' event is fired or the "over" event of the parent sortable is called. If you release the dragged element, it will actually get added to the nested sortable, without ever firing the over event. Something that should not be possible in my opinion.

This example has no styling. If you were to add more styling (as i have in my project) this problem gets worse because of padding/marings etc.

The over event seems to fire only if "enough" of the dragged element is over the nested sortable.

Change History (1)

comment:1 Changed 4 years ago by Swigle

As an update i've slightly modified the fiddle to show which sortable actually receives the "receive" event.

It's possible, aside from the aforementioned problem, that the item you drop in a sortable is added to the nested list, but the receive event of the parent list is called.

Version 0, edited 4 years ago by Swigle (next)
Note: See TracTickets for help on using tickets.