adobe / adobe/react-spectrum

RAC ComboBox option to select on item focus

Open
#5,681 3 comments 1 reaction 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 feature here

I'm building a search autocomplete and I want it ti behave similarly to Google/Amazon where highlighting an item to select it automatically.

I see that there's a SearchAutocomplete component in the works but it doesn't seem public yet. (And I assume it's Spectrum only so I have to wait for it to land to RAC.) The second easiest would be to have a prop that allows selection by focus. The third would be to expose an event handler that's called with highlighted key.

I'd go lower level with the hooks path but highlighted item doesn't seem to be exposed there either.

### 🤔 Expected Behavior?

There should be some way to use listbox highlighted item.

### 😯 Current Behavior

I couldn't find any way to access highlighted item.

### 💁 Possible Solution

_No response_

### 🔦 Context

Building a search autocomplete component.

### 💻 Examples

google.com
amazon.com

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.