holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
https://holiber.github.io/sl-vue-tree/
MIT License
345 stars 78 forks source link

Programmatically selecting prev/next in tree #6

Closed Alex-Sokolov closed 6 years ago

Alex-Sokolov commented 6 years ago

Is it possible to move selection by code?

For example, assume that selected Image Block 3:

2018-06-19 11 52 21

If we call method up — selection moved to Image Block 2 If we call method down — selection moved to Text Block 4

Thanks!

holiber commented 6 years ago

That looks like a good proposal. However, it is not clear how up and down methods are going to work with multiple selections. So I'm going to figure out some more flexible solution.

holiber commented 6 years ago

@Alex-Sokolov you can use getPrevNode and getNextNode methods from v1.6.0. See example keyboardcontrols.html in the demo folder.

Alex-Sokolov commented 6 years ago

@holiber Thanks! :)