Hi, I am trying to scroll to the bottom (or even b...
# kvision
t
Hi, I am trying to scroll to the bottom (or even better scroll to the position when the component was removed from DOM) of the component when it is inserted into DOM. I overrided function afterInsert() but it seems it does not work. Is there a way how to achieve it?
Copy code
override fun afterInsert(node: VNode) {
        super.afterInsert(node)
        val element = getElement()
        if (element != null) {
            with(element as HTMLElement) {
                scrollTop = scrollHeight.toDouble()
            }
        }
    }