Combobox async options#831
Draft
NoelDeMartin wants to merge 6 commits into
Draft
Conversation
36b52a1 to
f234b5d
Compare
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
…vent in Combobox
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.
f234b5d to
192fc7a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.