This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-30
Channels
- # adventofcode (1)
- # announcements (1)
- # babashka (5)
- # beginners (344)
- # bristol-clojurians (1)
- # calva (18)
- # cljfx (6)
- # clojure (85)
- # clojure-europe (37)
- # clojure-finland (1)
- # clojure-france (2)
- # clojure-nl (2)
- # clojure-taiwan (3)
- # clojure-uk (17)
- # clojurescript (13)
- # conjure (23)
- # cursive (25)
- # datomic (7)
- # fulcro (62)
- # java (7)
- # jobs-discuss (8)
- # malli (3)
- # off-topic (22)
- # portal (18)
- # reagent (34)
- # reitit (8)
- # releases (3)
- # shadow-cljs (18)
- # tools-deps (1)
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
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!
thanks @U47G49KHQ found it - https://github.com/cljfx/cljfx/issues/102 i'll dig in some
@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!