Add way to specify item keys in (Editable)ListComboBox
#726
Labels
api
Changes related to the public API
(Editable)ListComboBox
#726
We currently use the item index as key for the items, but that may cause issues when the items are reordered as the wrong item may end up selected.
Before #724 we were using the item content as key, as that's the implicit SLC behaviour, but that would also cause crashes when there are duplicates in the list.
This issue is to add a
itemKeys: (int, String) -> Any = { _, item -> item)
parameter on the(Editable)ListComboBox
components so users get back the correct behaviour the SLC produces by default, but can override it when they need to support duplicate values.We can also consider in the future creating a data model with the string and the key, and expose that as an alternative API, but I would avoid it for now.
The text was updated successfully, but these errors were encountered: