-
-
Notifications
You must be signed in to change notification settings - Fork 276
[docs][combobox] Async search examples #2947
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
Conversation
commit: |
45dac30 to
c933fee
Compare
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
c933fee to
8ce974f
Compare
8ce974f to
e5874e6
Compare
Signed-off-by: atomiks <cc.glows@gmail.com>
91b2ed6 to
e05794c
Compare
5926c54 to
3046f7f
Compare
3046f7f to
d4e964c
Compare
|
|
||
| ### Async search (single) | ||
|
|
||
| Load items from a remote source by fetching on input changes. Keep the selected item in the `items` list so it remains available while new results stream in. This pattern avoids needing to load items upfront. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the selected item in the items list so it remains available while new results stream in
@atomiks This makes sense for multiple but for single selection it doesn't seem that useful? Once a (single) selection is made, you won't get new results without clearing/re-typing a new input value:
Screen.Recording.2025-11-11.at.11.24.08.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also needs to stay present in the list since otherwise the selection gets removed, and typically that only happens if the entire input is cleared from text (and matches non-async demos)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that makes sense, I guess it's a bit confusing since the description is very similar to the async multiple one
This pattern is used when searching for selectable items without loading them all upfront. In this case, the selected value needs to be retained in the
itemslist at all times if present, as the internal logic removes selections if it disappears from the items list.Preview: https://deploy-preview-2947--base-ui.netlify.app/react/components/combobox#async-search-single