adobe / adobe/react-spectrum

useComboBox + useAsyncList does not show results after a call that was after a call that returned an empty list

Open
#9,820 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

We use Asynchronous loading with useComboBox.

We use useAsyncList as shown in the [documentation](https://react-aria.adobe.com/ComboBox/useComboBox.html#asynchronous-loading).

When we write something and the API returns no results, the next call does not update the comonent items, even if there are matching results.

We thought it was a bug on our side but we saw that the provided example had the same problem.

### 🤔 Expected Behavior?

Pressing "backspace" after writing "luka" should show "Luke Skywalker"

### 😯 Current Behavior

Pressing "backspace" after writing "luka" still doesn't show the results

### 💁 Possible Solution

_No response_

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

1. Go to the documentation example: https://react-aria.adobe.com/ComboBox/useComboBox.html#asynchronous-loading
2. Write "luka" --> no suggestions, because nothing matches "luka"
3. Press "backspace" --> the HTTP call is made, there is a response, but the ListBox inside the popover does not get updated:

Image

### Version

react-aria-components 1.15.1

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

Windows 11

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Research direction

Open the asynchronous-loading useComboBox documentation example and reproduce the sequence: search for "luka" until the list is empty, then press backspace. Inspect the useComboBox and useAsyncList entry points involved in updating the ListBox; done means the matching result appears after the second request, including after an empty response.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.