-
Hello, lets say I have to components, positioned side by side Component B is scrollable and has divs with ids I want to press a list item in Component A and Scroll Component B to the given Target from Component A. Currently nothing happens. Clicking some items which are definitely not in the viewport of Component B, will not result in scrolling. |
Beta Was this translation helpful? Give feedback.
Answered by
derHodrig
Jun 29, 2021
Replies: 1 comment
-
Got it to work, but with just javascript. First, we need access to our element via ID. After that it is simple, we start scrolling :D scrollToElement(message) {
const element = document.getElementById(
`${message.status.toLowerCase().split(' ').join('_')}_${message.id}`
)
element.scrollIntoView({ block: 'start', behavior: 'smooth' }) // holy grale
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
derHodrig
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got it to work, but with just javascript.
First, we need access to our element via ID. After that it is simple, we start scrolling :D