vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Confusing get_next_dom() and get_prev_dom() #2597

Closed shadoWalker89 closed 2 years ago

shadoWalker89 commented 2 years ago

Hi,

If we have three nodes

A B C

What the documentation says and what it is more logical to me is that if we are On node "B" then the get_next_dom() should return node "C" and the get_prev_dom() should return the node "A"

From the docs

image

image

If I'm not mistaken, I think that these two methods are doing the inverse of what they should be doing.

If so I think that this should be fixed in the next major version because it's obviously a breaking change.

Thanks for the amazing project, this is truly amazing and is the best tree plugin I have ever used.

vakata commented 2 years ago

get_prev_dom uses previousSibling and get_next_dom uses nextSibling (with some fixes around closed nodes, first node in collection, etc)