Skip to content

Autocomplete: ListBox doesn't render async loaded options when inside a SelectΒ #7940

@vladislavsz

Description

@vladislavsz

Provide a general summary of the issue here

When using Select, ListBox, and Autocomplete, together with async loading (e.g. useAsyncList):

  1. Popover fails to open when no items have been provided (you can uncomment initialFilterText in the provided sandbox to see this).
  2. ListBox doesn't update when the "items" prop changes. Adjusting the "dependencies" prop doesn't help.

πŸ€” Expected Behavior?

  1. When providing an empty list of "items" to ListBox inside a Autocomplete - the Select should still allow the Popover to open.
  2. ListBox should render the new "items" after fetching them asynchronously.

😯 Current Behavior

Described in the general summary of the issue.

πŸ’ Possible Solution

No response

πŸ”¦ Context

My use case is having no "items" at first, and only loading them in after the user has typed something in. I think this is a pretty popular scenario where, instead of returning an unrelated list of "items" on the first load (or hitting the API unncessarily without the user's interaction with the field), we require an explicit input/interaction from the user.

πŸ–₯️ Steps to Reproduce

https://codesandbox.io/p/sandbox/small-sea-jst6zm

Version

[email protected]

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS 15.3.1

🧒 Your Company/Team

No response

πŸ•· Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    🩺 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions