adobe / adobe/react-spectrum

Combobox Input requires hitting enter twice to submit a form

Open
#6,228 4 comments 2 reactions 0 assignees View on GitHub
ComboBox
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

Some of my consumers are trying to switch to our Combobox and are running into a few issues, one is #5234, so I'll respond in that issue for that

The other is that, when using "allowsCustomValue," it requires two enter presses to submit the html form when the popover is open - one to close the popover, one to submit the form. Generally, hitting enter inside of an input submits an HTML form, no JS required, but the combobox logic is stealing the keypress.

### 🤔 Expected Behavior?

When I hit enter inside of a combox input the html form submits

### 😯 Current Behavior

It requires two enters - one to close the popover, one to submit the form

### 💁 Possible Solution

_No response_

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/vigilant-frost-8fz2ns?file=%2Fsrc%2FApp.tsx

### Version

Dec 2023 release, except for overlays which is 3.19.0

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

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

OSX Sonoma

### 🧢 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.