Fork me on GitHub
#cljfx
<
2020-12-30
>
raaon04:12:08

interesting bug with ComboBox ... if the items observable list is updated via ObservableList/setAll (ie, combox.getItems().setAll(...)) (this appears to be what cljfx does), then the current selected item is lost by the component/JavaFx if ComboBox/setItems is invoked directly the issue doesn't manifest -- i don't know the cljfx code/model well enough to know if it could special case the list update for combo boxes my concrete use case: i need the combo box choices to be updated dynamically (eg, to add a new option) but i don't want to lose the current selection

vlaaad07:12:01

I think there is even an open issue in cljfx repo about setting items in combo-box. It's possible to create a custom prop that will call setItems, and I think it makes sense to use bug-less version of changing items in built-in items prop — PR welcome!

👍 3
raaon16:12:35

@U47G49KHQ here's a PR that i've confirmed fixes the issue: https://github.com/cljfx/cljfx/pull/113 , let me know if you have any notes. thanks!

vlaaad18:12:10

Many thanks, I'll have a look once I'm back from vacation, currently I don't have access to PC :)

👍 3
raaon04:12:08

i have a Java repro & "fix" and a small clfjx repro/example i can share if interested