Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging: Horizontal movement not recognized #562

Closed
ghost opened this issue Aug 18, 2015 · 12 comments
Closed

Dragging: Horizontal movement not recognized #562

ghost opened this issue Aug 18, 2015 · 12 comments

Comments

@ghost
Copy link

ghost commented Aug 18, 2015

A tree does not accept a node that is dragged with almost only horizontal movement. Only vertical movement seems to be recognized. See the following example:

example.gif

Tested with Chromium for Windows and Mac.

@ghost
Copy link
Author

ghost commented Aug 19, 2015

Finding the piece of code that causes this behavior isn't that hard. It's the dragMove-Method of the uiTreeNode. There's a condition if (!pos.dirAx) around line 315 that prevents the tree from accepting the node. But I haven't found a non hacky way of changing this yet.
This somehow works for me but I think it could break other setups: https://github.com/SvenJunga/angular-ui-tree-touch/commit/e12932b091f6650cb86ec7d9e89d5f3f2b1c1618#diff-2bd42e539aeba5277f65f2599dfc0338

@nulltone
Copy link

+1. I'm having the same problem.

@jacobscarter
Copy link
Contributor

+1

@zachlysobey
Copy link
Contributor

for reference, here the code that @svenjunga metioned above in context

if (!pos.dirAx))

uiTreeNode.js#L377

@danielforsberg
Copy link

+1

@ghost
Copy link
Author

ghost commented Mar 12, 2016

@zachlysobey have you found a better solution to this than my proposed hack? This seems to be a annoying bug to many people.

@zachlysobey
Copy link
Contributor

@svenjunga nope, haven't even tried or looked into it; Just tracked down that line of code in the hopes that it might make it a little easier for someone to dig into this and perhaps submit a PR.

@noherczeg
Copy link

+1

@jacobscarter
Copy link
Contributor

I think I have a fix for this I will implement soon, horizontal movement is not recognized because it is checking to see if you are moving a node within its own tree to "un-nest" it. I will add a bit that stops checking for that as soon as you leave the origin tree, so horizontal movement beyond that will be recognized as a node traveling. Not sure if this makes sense but I'll have the fix soon and can show via demo rather than just explaining it.

@jacobscarter
Copy link
Contributor

The fix I implemented here now uses tree IDs to determine if you are re-adjusting nestings rather than pixel measurements on the screen.

@jacobscarter
Copy link
Contributor

PR #824

@jacobscarter
Copy link
Contributor

Fix available in v2.22.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants