Skip to content

Combobox async options#831

Draft
NoelDeMartin wants to merge 6 commits into
SolidOS:stagingfrom
NoelDeMartin:improvements
Draft

Combobox async options#831
NoelDeMartin wants to merge 6 commits into
SolidOS:stagingfrom
NoelDeMartin:improvements

Conversation

@NoelDeMartin

Copy link
Copy Markdown
Member

No description provided.

@NoelDeMartin NoelDeMartin force-pushed the improvements branch 2 times, most recently from 36b52a1 to f234b5d Compare July 7, 2026 14:58
NoelDeMartin and others added 5 commits July 8, 2026 10:28
Prompt: I just implemented async options management, and I realized we have a problem with options where the value and label is different. In the options list, they display properly, but when you select an option, what ends up in the input is the value, not the label; which is confusing from a UX perspective. Can we fix that?

AI work summary:

- Introduced a new state variable `displayValue` to manage the displayed value in the input.
- Updated the `onValueChanged` handler to set `displayValue` based on user input.
- Modified `selectOption` method to accept a `ComboboxOptionData` object and update `displayValue` accordingly.
- Ensured `displayValue` is initialized with the current value when the component updates.

Co-Authored-By: Cursor <cursoragent@cursor.com>
This will reduce unnecessary network requests
The previous implementation was a bit clunky with the autocomplete and default options list after opening with async options. It also split the concern for watching value changes in two parts (onValueChanged vs willUpdate). This implementation should be more reliable and also supports fallback options and the "change" event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix combo boxes

1 participant