Scroll to the selected node in Tree

UI Components for React
Post Reply
saranya
Posts: 7
Joined: 25 Nov 2019, 16:36

25 Jun 2020, 12:46

When i pass selectednodekey as props to Tree. the node is getting selected but it is not visible in the screen if it is at the bottom of the scroll. I wanted to use scrollIntoView on the selectedNode whenever the props gets changed.. is there a way get the DOM node of the selected Tree node? I tried using onselectionchange and onselect it works only when user selects in tree,if the props changes those events are not triggered. Please let me know if there are any api or events exposed for getting the selected node element. Even better if there is a way to scroll to the selected node in the Tree

saranya
Posts: 7
Joined: 25 Nov 2019, 16:36

01 Jul 2020, 10:49

Problem: i have an container with fixed height, if there are more tree nodes then scroll will be shown... i have an button somewhere in UI , on clicking that i will have to select an node in the tree. If the node is at the bottom of the scroll container,...it is highlighted but i will have to scroll to see that..

Question: is there a way to focus the selected node in UI or scroll to the selected node automatically?

Would really appreciate if there is any idea or solution.

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests