Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#6085 closed bug (fixed)

Parent droppable takes precedence over dynamically created child droppable

Reported by: sslotsky Owned by:
Priority: minor Milestone: 1.8.17
Component: ui.droppable Version: 1.8
Keywords: Cc:
Blocked by: Blocking:

Description

If a container is droppable, then if a dynamically created element is placed within the container and made to be droppable, the parent container always takes precedence, so the drop event for the new droppable never fires.

To see this, open the attached html file in your browser and fix the reference to jquery-ui.

  1. Drag the 'Drag me!' text into the container. After reading the alert, an orange box will append to the container. The orange box should be droppable.
  2. Drag the 'Drag me!' text into the orange box. The same alert as you saw in step 1 will occur, and a new orange box will be appended. This indicates that the drop function for the container fired, but the drop function for the orange box did not.

Please note that the 'refreshPositions' option does not solve this problem.

Attachments (1)

precedence.html (1.2 KB) - added by sslotsky 13 years ago.

Download all attachments as: .zip

Change History (16)

Changed 13 years ago by sslotsky

Attachment: precedence.html added

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

Milestone: TBD1.9

This apparently broke somewhere between 1.7.2 and 1.8.0. Setting greedy to true does cause the in droppable to get activated, though it also properly prevents the outer droppable from being activated. With greedy false, both should get activated and only the outer does.

comment:2 Changed 13 years ago by Scott González

Version: 1.8.41.8

comment:3 Changed 12 years ago by sslotsky

Apparently the attachments have been removed and I don't currently have any copies to post on jsFiddle... I'll work something up when I can.

comment:4 Changed 12 years ago by Scott González

The attachment works fine for me.

comment:5 Changed 12 years ago by sslotsky

Well in any case, I've created a jsFiddle:

http://jsfiddle.net/ahqQg/1/

Instructions are the same as in the bug description.

comment:6 Changed 12 years ago by bikeshedder

I just stumbled across the same issue and prepared a test case for this. This is probably related to #6009.

http://jsfiddle.net/PHQHb/5/

comment:7 Changed 12 years ago by bikeshedder

comment:8 Changed 12 years ago by Michael P. Jung

Resolution: fixed
Status: newclosed

Droppable: Make sure._drop is called for all relevant droppables. Fixes #6009 - Upper droppable should receive draggable. Fixes #6085 - Parent droppable takes precedence over dynamically created child droppable.

Changeset: fdc332ed5fb7f7e688151d5cae9b450569d73da5

comment:9 Changed 12 years ago by Michael P. Jung

Droppable: Make sure._drop is called for all relevant droppables. Fixes #6009 - Upper droppable should receive draggable. Fixes #6085 - Parent droppable takes precedence over dynamically created child droppable. (cherry picked from commit fdc332ed5fb7f7e688151d5cae9b450569d73da5)

Changeset: f7b28df28809bca05623b7394919d15919334afb

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

Milestone: 1.91.8.17

comment:11 Changed 11 years ago by tabiul

I do not think the fix solves the issue that is raised by this ticket. It seems to fix the issue where the parent droppable should receive precedence overchild droppable. The issue that I and the author for this ticket is facing is that when a dynamically created droppable is added to pre-existing droppable then the new child droppable never get focus. All the draggable seem to be consumed by the parent droppable.

comment:12 Changed 11 years ago by sslotsky

tabiul is correct. Please see the jsfiddle at http://jsfiddle.net/PHQHb/5/, this issue is *not* fixed.

comment:13 Changed 11 years ago by Scott González

This is fixed. You're still testing against 1.8.16, which does not contain the fix.

comment:14 in reply to:  12 Changed 10 years ago by daia

Replying to sslotsky:

tabiul is correct. Please see the jsfiddle at http://jsfiddle.net/PHQHb/5/, this issue is *not* fixed.

Was it fixed?

Version 0, edited 10 years ago by daia (next)

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

Yes. Did you read my response?

Note: See TracTickets for help on using tickets.