Opened 10 years ago

Closed 8 years ago

#9736 closed defect (fixed)

Tree: initial drag over tree node shows red avatar, should show green

Reported by: bill Owned by:
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description

When the Tree doesn't have any padding between the Tree.domNode and the nodes inside the tree, then when a user initially drags a node over the tree, the avatar is red even when it should be green.

Problem can be reproduced in test_Tree_Dnd.html by commenting out

@import "../../../dojo/tests/dnd/dndDefault.css";

That file (when included) defines

.container {
    ...
    padding:1em 3em;
}

which avoids this problem.

It's a timing problem because the Tree.domNode hover event occurs after the TreeNode's hover event. _dndContainer.js does the connections calling these two functions.... it even connects for onOverEvent() first:

Tree hover event:

dojo.connect(this.node, "onmouseenter", this, "onOverEvent"),

TreeNode hover event:

dojo.connect(this.tree, "_onNodeMouseEnter", this, "onMouseOver"),

But onMouseOver() is getting called first... I guess that the TreeNode hover event occurs before the Tree's hover event.

onMouseOver() calls dojo.dnd.Manager.canDrop(true) but onOverEvent() hasn't been called yet, dojo.dnd.Manager.target == null so it fails.

Change History (6)

comment:1 Changed 10 years ago by Jean-Rubin Leonard

After adding the dnddefault.css to try to solve the issue I am still experimenting (yes i did clear my cache). I am unsure of why it works on Bill's side yet I can reproduce it repeatedly. JR

comment:2 Changed 10 years ago by bill

I forgot to mention (or didn't notice) that test_Tree_DnD.html specifically uses that container class on Tree:

<div class="container" dojoType="dijit.Tree">

BTW, even adding the padding probably won't solve the problem 100%... if the user moves the mouse quickly then it could jump over the padding and thus the first mouse event will occur on the tree row, thus causing the timing problem. But the padding will eliminate the problem in most cases (I think).

comment:3 Changed 10 years ago by bill

Milestone: tbd1.5

comment:4 Changed 9 years ago by Adam Peller

Milestone: 1.51.6

comment:5 Changed 9 years ago by bill

Milestone: 1.6future

comment:6 Changed 8 years ago by bill

Milestone: future1.4
Resolution: fixed
Status: newclosed

I think this hasn't been an issue since [16117] when we started processing most events in _onMouseMove(). Nowadays dndSource.js doesn't even have an _onMouseOver() method. In any case I confirmed it's broken in 1.3 but working in 1.4.

Note: See TracTickets for help on using tickets.