Scroll to top when open an item

Hi

I’m a beginner front-end Halogen developer. I face a surprising problem with my demo app. It’s a catalog of items, where you can choose one and it’ll open in the expanded view. The problem is when you scroll down the items and click on an item on the bottom, the expanded view is already scrolled down.

What is the most idiomatic way to solve this in Halogen?

Thank you

I think the most straightforward way would be to use HH.ref to track the row elements, paired with something like https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

2 Likes