ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
29 stars 8 forks source link

nimble-select: picking an item by typing its label stops working after picking an item from the dropdown via keyboard interaction #2082

Open jattasNI opened 2 months ago

jattasNI commented 2 months ago

🐛 Bug Report

You should be able to change the value of a select by tab focusing it and then typing the start of the name of one of the items. This works initially but seems to stop working after picking an item by opening the dropdown.

💻 Repro or Code Sample

  1. open storybook for select with filter mode set to 'none'
  2. tab focus the select
  3. without opening, type 'z' and Zurich is correctly selected with a change event fired
  4. tab away
  5. shift tab back
  6. Enter to open, arrow keys to change the value, Enter to commit
  7. Now type 'z' again. Nothing happens.

🤔 Expected Behavior

Step 3 above

😯 Current Behavior

Step 7 above

💁 Possible Solution

🔦 Context

Discovered in this PR thread: https://github.com/ni/nimble/pull/2079#discussion_r1593939751

🌍 Your Environment

macOS Firefox

atmgrifter00 commented 2 months ago

This is a bug in FAST. Update their example and you will see the same behavior.

atmgrifter00 commented 1 month ago

The fix for this is likely to bring over the FAST Listbox implementation for handleTypeAhead (as an override) and make a small change that resets the typeaheadBuffer in the timeout callback. However, it's worth putting this off until we undertake the larger refactor that will ultimately sever the relationship between the Nimble Select and the FAST Listbox.