cljfx

https://github.com/cljfx/cljfx
2020-12-30T04:22:08.211300Z

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

2020-12-30T15:00:24.212600Z

thanks @vlaaad found it - https://github.com/cljfx/cljfx/issues/102 i'll dig in some

2020-12-30T16:47:35.213200Z

@vlaaad 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!

vlaaad 2020-12-30T18:52:10.213500Z

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

1👍
2020-12-30T04:23:08.212100Z

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

vlaaad 2020-12-30T07:24:01.212200Z

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!

1👍
2020-12-30T15:00:24.212600Z

thanks @vlaaad found it - https://github.com/cljfx/cljfx/issues/102 i'll dig in some

2020-12-30T16:47:35.213200Z

@vlaaad 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!

vlaaad 2020-12-30T18:52:10.213500Z

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

1👍