react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

ComboBox input clears when the text inside it is longer than its width and starts to scroll horizontally

Open nkalpak opened this issue 1 year ago โ€ข 0 comments

Provide a general summary of the issue here

When rendering the ComboBox as it is directly taken from the starter kit, when you write enough text inside the input to overflow horizontally, the entire input will reset.

๐Ÿค” Expected Behavior?

The input shouldn't reset

๐Ÿ˜ฏ Current Behavior

The input resets

๐Ÿ’ Possible Solution

I've investigated a bit and found the code in useComboBoxState.ts:237 to look suspicious. When adding both the selectedKey and inputValue to make the ComboBox controlled, the input is no longer cleared.

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

  1. Go to this codesandbox
  2. Try typing "Strawberry" into the input
  3. Observe that the input is cleared when you reach the point that the text starts overflowing horizontally

Version

1.2.0

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

If other, please specify.

No response

What operating system are you using?

MacOS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

nkalpak avatar May 10 '24 11:05 nkalpak