cljfx

https://github.com/cljfx/cljfx
vlaaad 2019-06-20T20:36:45.021700Z

@ambrosebs I played with it a bit and it also was broken for me

vlaaad 2019-06-20T20:37:20.022400Z

tried to create a smaller repro to narrow down what's wrong, looks like a problem in javafx internals ¯\(ツ)

vlaaad 2019-06-20T20:38:58.023700Z

one solution I found is setting :fx/keys of tabs to (UUID/randomUUID) to force cljfx to recreate tabs, which kind of defeats the purpose of it

vlaaad 2019-06-20T20:40:33.025100Z

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

vlaaad 2019-06-20T20:42:41.025700Z

Here is a minimal example of tab pane adding tabs in an order that makes sense: https://gist.github.com/vlaaad/ec3793f55b654a8b1e4dc81b3cddc74b

vlaaad 2019-06-20T20:48:22.027500Z

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

vlaaad 2019-06-20T21:05:47.029200Z

ehh, this solution with clear is also buggy: sometimes it duplicates tabs, sometimes it remove all text from one of the tabs...

2019-06-20T22:43:50.030Z

@vlaaad thanks for looking! I'll try out the :fx/key solution.

2019-06-20T23:21:42.032Z

the fresh :fx/key workaround seems to disallow dragging of unselected tabs. still, it's the closest to "working" 😛

2019-06-20T23:22:32.032300Z

I guess by the time you click them, they're a different tab.

😄 1
2019-06-20T23:44:58.033200Z

as far as I can tell, the ObservableList at getTabs is being correctly updated in sync, but the UI is not updating in response.

2019-06-20T23:45:23.033600Z

(going back the no-workaround example)