Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13971 closed defect (fixed)

A dojo.dnd.Source does not seem to work any more when contained in a dijit.layout.ContentPane.

Reported by: Patrick Ruzand Owned by: bill
Priority: high Milestone: 1.7
Component: DnD Version:
Keywords: Cc: pruzand@…
Blocked By: Blocking:

Description

See attached example which creates two dojo.dnd.Sources, each containing one item. The first source is not contained in a ContentPane?, the second source is. The first source works fine, but the item of the second source cannot be dragged. (Not sure the ContentPane? is the only case that breaks, it just happens to be the case where I found the pb).

Just drop dnd.html at the same level as dojo/ dijit/ to reproduce.

This worked fine in 1.7b5 and before, but is broken in the trunk.

Attachments (1)

dnd.html (1.3 KB) - added by Patrick Ruzand 8 years ago.
testcase

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Patrick Ruzand

Attachment: dnd.html added

testcase

comment:1 Changed 8 years ago by Chris Mitchell

Owner: changed from Eugene Lazutkin to kriszyp

comment:2 Changed 8 years ago by bill

Owner: changed from kriszyp to Kris Zyp

I don't know why you assigned this to Kris but his id is kzyp.

comment:3 Changed 8 years ago by Kris Zyp

Owner: changed from Kris Zyp to bill

This bug is a regression due to commit [26531]. It is beyond me to fix issues from [26531], I think Bill will need to take a look at this. I locally reverted this change and the test page works fine.

Last edited 8 years ago by Kris Zyp (previous) (diff)

comment:4 Changed 8 years ago by Kris Zyp

If it helps at all, in debugging this issue, the problem was that the ContentPane? did not think it had any children (and I believe it should recognize the inner dnd Source as a child), and therefore did not call startup() on the Source component inside of it. Without startup() called the Source did not properly initialize and prepare to handle dnd. I thought maybe _checkIfSingleChild should be detecting the inner component, but the Source is definitely not passing the conditions in _checkIfSingleChild and registering as a child. The startup() on the ContentPane? was getting called, and startup() on the upper Source (the one not in the ContentPane?), but not in the Source inside the ContentPane?. Hope that helps.

comment:5 Changed 8 years ago by bill

Indeed I did break this. You are right that ContentPane doesn't think it has any children, because the dojo.dnd.Source doesn't register itself as a widget. ContentPane has some code to work around this problem in _startupChildren() but it inadvertently broke in [26531] because that code isn't getting called anymore. Strangely the dijit/tests/layout/ContentPane.html nonWidget() test case still works.

comment:6 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

In [26740]:

Fix problems where ContentPane was not calling startup() on non-widget children. Fixes #13971, refs #13887 !strict.

comment:3 Changed 8 years ago by bill

In [26762]:

At the time that submitButton.startup() is called, form.isValid() isn't ready to give the right answer. Switch form.isValid() call to run after form.startup() completes. Refs #13971, #13887.

Note: See TracTickets for help on using tickets.