#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: | [email protected]… | |
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)
Change History (8)
Changed 11 years ago by
comment:1 Changed 11 years ago by
Owner: | changed from Eugene Lazutkin to kriszyp |
---|
comment:2 Changed 11 years ago by
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 11 years ago by
Owner: | changed from Kris Zyp to bill |
---|
comment:4 Changed 11 years ago by
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 11 years ago by
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.
testcase