Server paginated + searchable Select, ListBox "items" prop question #8803
-
For a serverside searchable + paginated Select component, does the object to which the current SelectedKey belongs, have to be in the ListBox's "items" prop? If ListBox's "items" prop doesn't have the object to which the current SelectedKey belongs, it defaults to the placeholder. It seems like I'm forced to include the current object in the "items" prop at all times. (see attached video) Is it possible to manage the selected state by using only ? I feel like it shouldn't matter if the currently selected ID's object isn't present in "items" if I'm managing the selected state myself in . Here's a video of what I mean: Screen.Recording.2025-08-30.at.9.50.18.PM.mov |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for the discussion, I'm unfortunately having a hard time telling what's going on in that video. Would you be willing to make a codesandbox or stackblitz to demonstrate the behaviour? I was looking at https://react-spectrum.adobe.com/react-aria/examples/searchable-select.html and if I'm interpreting your question and demo correctly, the selected key's item does not need to be in the ListBox. Granted this isn't an async list. So I think a demo would be very helpful to make sure I'm understanding this correctly. Thank you! |
Beta Was this translation helpful? Give feedback.
Ok I think I understand the question you have now. No I don't think you're missing a prop, but I'm not sure how we could pass the object to SelectValue if it's not in items. We wouldn't know about it. So I think you should account for it in your SelectValue component. Does something like this work for you?