Sochettra / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Folder node drags without mousedown and with dynatree exception: sourceNode is null. #259

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Configure tree with dnd options
2. Ensure onDragStart allows dragging folders
3. Expand a folder

- jquery.dynatree.js function _initDragAndDrop(tree) is called.
- helper function's sourceNode is always null
- browsers throws many exceptions thereafter:

sourceNode is null
return sourceNode.tree._onDragEven...sourceNode, null, event, null, null); 
jquery.dynatree.js, Line 3162

What is the expected output? What do you see instead?
For folder to *not* start dragging without mouse button being down (nor during 
lazy load).
AND
No dynatree exceptions.

What version of the product are you using?
$Revision: 528, 2011-09-17 18:58:59$

On what operating system and browser?
Windows 7 Pro, Firefox 8.0

Please provide any additional information below.
QUESTION: what is best way to disable dnd while lazy loading?  I can 
remove/readd dnd options while lazy loading, but that does not seem like a good 
idea (abstraction/encapsulation violation on dynatree).

If not reproducible or obvious question, I will see about jsfiddle reproducible 
example.  But, I have to setup mock-up data and such, so hoping the 
question/situation is solvable just asking.

Original issue reported on code.google.com by wbgil...@gmail.com on 27 Dec 2011 at 10:10

GoogleCodeExporter commented 8 years ago
You could use `node.hasChildren() === undefined` to check for unloaded/loading 
lazy nodes.
Another way is to test for the 'dynatree-loading' class.
Then, return `false` in onDragStart.
I opened issue 260 for a more elegant solution

Original comment by moo...@wwwendt.de on 28 Dec 2011 at 9:04

GoogleCodeExporter commented 8 years ago
I couldn't reproduce the bug on Safari (trying FF later).
How do you expand the node? Using keys?

Original comment by moo...@wwwendt.de on 28 Dec 2011 at 10:28

GoogleCodeExporter commented 8 years ago
Expand the folder node by clicking on the dynatree-expander image.

Original comment by wbgil...@gmail.com on 28 Dec 2011 at 3:39

GoogleCodeExporter commented 8 years ago
Tried with FF9 on Windows Vista here
    http://wwwendt.de/tech/dynatree/doc/sample-dnd.html#
Everything looks OK...
I can expand and then drag or even drag the expander icon without exceptions.

Can you reproduce it there?

Original comment by moo...@wwwendt.de on 28 Dec 2011 at 5:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
No, but I'm holding off on this one because it does not reproduce with a later 
version, r543 (the autoscroll fix).  (Debugging it, the mousedown to expand is 
somehow also seen as a dragstart after 'tolerance' mouse movement.  Again, not 
repro'ing in r543 so waiting on autoscroll issues). 

r543 has outstanding issues with autoscroll I reported.  If they're resolved 
and this doesn't repro, that'd be great.  :-))

Original comment by wbgil...@gmail.com on 28 Dec 2011 at 10:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This can be reproduced with r570, but I have dynatree wired up to my server for 
lazy loading so I'm not sure how to make a repro for you.

The problem: a folder node starts dragging without the mouse down and during 
lazy loading.  See two attached screen shots where you can still see the 
loading icon while the node has been dragged.

In my dragStart I tried this:

                onDragStart: function (node) {
                    if (node.isLoading()) {
                        return (false);
                    }
                     ...

But, that did not work.

I'm looking for other/more things to check in DragStart to avoid this.  Ideas?

I think it's time-based.  Lazy loading taking a second or three is easier to 
reproduce.  Loading from data already on the client (e.g. the dynatree 
examples) never reproduced the problem.

Original comment by wbgil...@gmail.com on 29 Dec 2011 at 10:22

Attachments:

GoogleCodeExporter commented 8 years ago
I will try with the Python test server, but Probably Not before saturday

Original comment by moo...@wwwendt.de on 29 Dec 2011 at 11:07

GoogleCodeExporter commented 8 years ago
I tried this with FF9 and 5 second delayed Ajax requests:
- click on th [*] to expand a lazy node
- while the node is loading (spinning wheel) move the mouse around without 
pressing a key

--> no problems here :-/

I also tried your 
    if(node.isLoading()) return false;
an that works as expected to prevent dragging while loading.

Original comment by moo...@wwwendt.de on 31 Dec 2011 at 11:39

GoogleCodeExporter commented 8 years ago
Thanks for trying.
If I point you to my server would you take a look?  

Original comment by wbgil...@gmail.com on 31 Dec 2011 at 9:56

GoogleCodeExporter commented 8 years ago
sure, 
happy new year by the way :)

Original comment by moo...@wwwendt.de on 1 Jan 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Ben,

I clicked on the "Business Units" tree expanders and moved the cursor shortly 
after that.
Looks ok to me, although the loading times are very fast, so maybe I am missing 
your described effects :-/ (using FF9.0.1 on Vista)

For testing you could comment out yout onClick-handler, maybe that interferes 
in some way...
And please try again, if node.isLoading() rellay returns false.

If all this doesn't work, I could modify the code to no start dragging, when 
the user tries to drag the expander icon - i think that wouldn't hurt.

Original comment by moo...@wwwendt.de on 3 Jan 2012 at 6:11

GoogleCodeExporter commented 8 years ago
Martin,

try this, it reproduces the problem every time for me:

1. Go to that URL I emailed you.
2. Drag the Clinology node to the Unassigned Hosts list and drop it.
   - The nodes under Clinology will disappear from the dynatree and appear in the Unassigned Hosts.
3. Drag an Unassigned Host to the Clinology node and try to drop it on it.  The 
dynatree drop event will not occur without first clicking the dynatree.  

Original comment by wbgil...@gmail.com on 3 Jan 2012 at 7:10

GoogleCodeExporter commented 8 years ago
> The dynatree drop event will not occur without first clicking the dynatree.  
Therefore, be sure *not* to click on anything but the above 1, 2, 3.  :-)

Original comment by wbgil...@gmail.com on 3 Jan 2012 at 7:11

GoogleCodeExporter commented 8 years ago
Hi Martin, did you try again?  Haven't see a post/reply in 2 days. :-)

Original comment by wbgil...@gmail.com on 6 Jan 2012 at 4:27

GoogleCodeExporter commented 8 years ago
not yet, sorry. hope i find some time on the weekend

Original comment by moo...@wwwendt.de on 6 Jan 2012 at 7:38

GoogleCodeExporter commented 8 years ago
Hi Ben,

is this problem related to your comment #8 (how)?
It seems you are describing a different bug here?

Your site is pretty complex, and I can't add debug code there (even Dynatree's 
debugLevel is 0, cause you're using a release build, so I see no output).
So it's hard for me to debug. 

This sample - using a standard draggable - seems to work though:
  http://wwwendt.de/tech/dynatree/doc/sample-dnd3.html

1. open the page
2. drag 'Drag me around' and drop over the right tree.

If you can tweak this sample so that we can reproduce the problem, I could 
easier try help.

Original comment by moo...@wwwendt.de on 7 Jan 2012 at 8:18

GoogleCodeExporter commented 8 years ago
ok, I think your comment #14 refers to issue 264

Original comment by moo...@wwwendt.de on 7 Jan 2012 at 10:02

GoogleCodeExporter commented 8 years ago
can you still reproduce this issue (Folder node drags without mousedown and 
with dynatree exception: sourceNode is null)?

Original comment by moo...@wwwendt.de on 14 Jan 2012 at 9:19

GoogleCodeExporter commented 8 years ago
Yes it still happens
But I cannot reproduce it at-will.

Original comment by wbgil...@gmail.com on 14 Jan 2012 at 9:32

GoogleCodeExporter commented 8 years ago
Deferred, so v1.2.1 can be released shortly.

Original comment by moo...@wwwendt.de on 6 Jun 2012 at 7:47

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 6 Oct 2012 at 9:31

GoogleCodeExporter commented 8 years ago
Closing 'Waiting' issues without timely answer

Original comment by moo...@wwwendt.de on 6 Oct 2013 at 2:09

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 3 May 2014 at 4:37