#Auto scroll to bottom tutorial/example request

4 messages · Page 1 of 1 (latest)

harsh mortar
#

Does anyone have an example to have auto scrolling to the bottom (Like in a chat message feed) of a HTMLDivElement? I've personally tried 10 different ways (most involving some sort of scrollTop = scrollHeight and I can't get it to work and I can't find any example by Qwik or community

#

The children in the div (trying to scroll) comes from an Object.entries().map() on a useStore and the elements do appear and update as expected. I just can't get the scrolling on the paremnt element of those elements

split yew
#

have u tried adding useVisibleTask$ to track the store and adding ref to the bottom element of your scrolling area so that if the store changes you can call the ref.value.scrollIntoView?

west rain