https://kotlinlang.org logo
Title
b

bartosz.malkowski

04/18/2023, 1:10 PM
Im trying to achieve effect similar to
_LazyColumn(reverseLayout_ = true)
using `compose.html` . I have no idea how to scroll my
div
to bottom after new elements appears in state. Anyone know?
o

Oleksandr Karpovich [JB]

04/19/2023, 9:01 AM
b

bartosz.malkowski

04/19/2023, 10:19 AM
The most mystic part was "how to do that after new elements were added" 😛 I did something like this:
Div {
	items.forEach { item ->
        DisplayItem(item)
	}
	DisposableEffect(items) {
		this.scopeElement.scrollTo(ScrollToOptions(left = 0.0, top = this.scopeElement.scrollHeight.toDouble()))
		onDispose { }
	}
}