liquor-tree icon indicating copy to clipboard operation
liquor-tree copied to clipboard

Scroll to selected node

Open bajki opened this issue 3 years ago • 1 comments

Hi, if i have 100 nodes, how to scroll to selected node on initial render?

Thanks

bajki avatar May 13 '21 08:05 bajki

I'm having this same problem. It seems that we need an event when the complete tree is fully rendered. For the scrolling support I use vue-scrollto, which seems to work when the tree is rendered instantly.

I made this (foolish) workaround for the time being (just put in in the mounted() method, after the async data is loaded).

setTimeout(() => {
  VueScrollTo.scrollTo('#YOUR_ID', 500, {
    container: '#tree-container',
    offset: -100,
  })
}, 1000)

Keep in mind that the container has be scrollable.

FRizZL avatar May 18 '21 11:05 FRizZL