@ambrosebs I played with it a bit and it also was broken for me
tried to create a smaller repro to narrow down what's wrong, looks like a problem in javafx internals ¯\(ツ)/¯
one solution I found is setting :fx/key
s of tabs to (UUID/randomUUID)
to force cljfx to recreate tabs, which kind of defeats the purpose of it
the other one is a bit better: to clear tabs list before setting it with new tabs. it will make animations weird: tabs will look re-appearing all the time, so I disabled animation on them and it looks fine to me
Here is a minimal example of tab pane adding tabs in an order that makes sense: https://gist.github.com/vlaaad/ec3793f55b654a8b1e4dc81b3cddc74b
not really sure what to do about it, I can make it a default behavior for tab pane, because it's less broken, although it might be a surprising because other list mutators just use setAll
without clear
ehh, this solution with clear
is also buggy: sometimes it duplicates tabs, sometimes it remove all text from one of the tabs...
@vlaaad thanks for looking! I'll try out the :fx/key
solution.
the fresh :fx/key
workaround seems to disallow dragging of unselected tabs. still, it's the closest to "working" 😛
I guess by the time you click them, they're a different tab.
as far as I can tell, the ObservableList at getTabs
is being correctly updated in sync, but the UI is not updating in response.
(going back the no-workaround example)