Skip to content

How can I scroll a node in to view area? #487

Answered by bcakmakoglu
amjadaliup asked this question in Q&A
Discussion options

You must be logged in to vote

Simplest way to do this is using the fitView action.
The fitView action accepts an array of node ids that it's supposed to fit around.

const { fitView } = useVueFlow()

const onClick = () => {
	 fitView({ padding: 1, nodes: ['1'] })
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bcakmakoglu
Comment options

@amjadaliup
Comment options

Answer selected by amjadaliup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants