Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add way to specify item keys in (Editable)ListComboBox #726

Open
rock3r opened this issue Dec 11, 2024 · 0 comments
Open

Add way to specify item keys in (Editable)ListComboBox #726

rock3r opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
api Changes related to the public API

Comments

@rock3r
Copy link
Collaborator

rock3r commented Dec 11, 2024

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.

@rock3r rock3r added the api Changes related to the public API label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Changes related to the public API
Projects
None yet
Development

No branches or pull requests

2 participants