vue-treeselect icon indicating copy to clipboard operation
vue-treeselect copied to clipboard

Expand parent nodes of selected item. Scroll menu to selected item.

Open varlamov88 opened this issue 6 years ago • 4 comments

If i have multilevel tree and v-model has an initial value (for example, from db), that lies deep on the tree, i cant see selected value, when open "treeselect". defaultExpandLevel open all nodes, its not suitable. lastScrollPosition doesnt work, when i open page first time. It has srollTop = 0. And i want open menu with selected item located in the center, not with "saveMenuScrollPosition" from the last time.

Second commit is about expand parents in search mode then children id selected. I have this state (on screenshot). Then I input "AB" to the search area, tree expanded and I select "AB" item, then tree is collapsed and selected item is not visible. P.S. I dont need expand all levels by default. Screenshot_1

varlamov88 avatar Nov 07 '19 16:11 varlamov88

Is there anything new about this feature and a possible release date?

gulbaek avatar Jan 21 '20 20:01 gulbaek

nice PR!!! Thank you for the fix @varlamov88!

I tested this.expandParentNodes() should be in openMenu() like the follow:

     if (this.scrollPositionOnCenter) {
       // if in initialize(), when second open menu cannot scroll menu 
       // because $option = document.querySelector(".vue-treeselect__option--selected");
       // will not initial then null
       this.expandParentNodes();  
       this.$nextTick(this.scrollMenuOnCenter);
      }

emacle avatar Jul 03 '20 02:07 emacle

Have any question on this PR?

I also have this question need this PR, so whether consider to merge this right now if have no question else?

lenqwang avatar Aug 13 '20 07:08 lenqwang

any news about merge this pr ?

felipyamorim avatar Mar 16 '22 19:03 felipyamorim