I want to be able to automatically scroll to the bottom of a a Scroll whenever content is changed.
Here is a simplified version of my setup:
I have a button that modifies the state of AppState::log (appends text or any operation that modifies it)
I have a Scroll<AppState, Label<AppState>>
I want the scroll to automatically go to the bottom of the content whenever it is updated.
i have also seen something similar in #2034 but it seems that it has the same issue as my implementation.
General description
I want to be able to automatically scroll to the bottom of a a Scroll whenever content is changed.
Here is a simplified version of my setup: I have a button that modifies the state of
AppState::log
(appends text or any operation that modifies it) I have aScroll<AppState, Label<AppState>>
I want the scroll to automatically go to the bottom of the content whenever it is updated.
i have also seen something similar in #2034 but it seems that it has the same issue as my implementation.
My attempts at solving this
I made a custom controller that looks like this:
This partially works and only goes to the somewhere near bottom of the text that was written before the last log.
I am not quite sure why this is but any help on this would be greatly appreciated!