vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 762 forks source link

Combobox option focus is not reset when input is changed #6582

Closed KingMario closed 2 years ago

KingMario commented 2 years ago

Describe the bug

After type in search text and use [UpArrow]/[DownArrow] to focus an option (say, Option A), if you change the search text and hit [Enter], the previously focused Option A is selected.

How to reproduce

Steps to reproduce the behavior:

  1. Go to this page.
  2. Enter ca and use [DownArrow] to focus California.
  3. Hit backspace twice.
  4. Enter miss.
  5. Observe no item is focused.
  6. Hit [Enter].
  7. Observe California is selected.

Expected behavior

On step 5, the focused model should be reset. On step 7, the first searched item, i.e., Mississippi should be selected.

Versions

Clarity project:

Clarity version:

Framework:

Additional notes

Even worse, go to this page. Enter ca and hit [Enter]. Alabama is selected.

By blind guessing, maybe this can help fix it but I could not setup the local dev environment to verify it.

image

github-actions[bot] commented 1 year ago

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.