Fork me on GitHub
#cljfx2020-06-10
>
jrwdunham20:06:14

I'm trying to figure out how to make a :fx/type :scroll-pane scroll to the bottom (`:vvalue 1.0`) whenever a new child is added to the :children of the :fx/type :v-box that is the value of the scroll-pane's :content. Could somebody please advise?

vlaaad21:06:58

@jrwdunham my solution so far

vlaaad22:06:06

the idea is to just force scroll pane scroll to bottom whenever its viewport bounds change — this happens when nodes are added.

vlaaad22:06:51

this might be a problem if nodes inside the scroll pane can be resized themselves, I don't have anything better in my mind right now. I tried to go with observing content's children list, but that seemed to update scroll too early, so it first scrolled to bottom and then updated the scroll pane...