Ticket #6085 (closed bug: fixed)

Opened 4 years ago

Last modified 12 months ago

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:
Blocking: Blocked by:

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

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

Change History

Changed 4 years ago by sslotsky

comment:1 Changed 4 years ago by scott.gonzalez

  • Milestone changed from TBD to 1.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 4 years ago by scott.gonzalez

  • Version changed from 1.8.4 to 1.8

comment:3 Changed 3 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 3 years ago by scott.gonzalez

The attachment works fine for me.

comment:5 Changed 3 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 3 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 3 years ago by bikeshedder

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

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

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 2 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 2 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.17

comment:11 Changed 2 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 follow-up: ↓ 14 Changed 2 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 2 years ago by scott.gonzalez

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

comment:14 in reply to: ↑ 12 Changed 12 months ago by daia

Was it fixed?

Last edited 12 months ago by daia (previous) (diff)

comment:15 Changed 12 months ago by scott.gonzalez

Yes. Did you read my response?

Note: See TracTickets for help on using tickets.