orchidjs/tom-select

[Bug]: Quick Enter key selects wrong item

Opened this issue · 0 comments

Bug description

If you enter text into a Tom Select control, then press the Enter key before the dropdown has been filtered, the wrong item will be selected.

Expected behavior

Entering text into a Tom Select control, then pressing Enter, should always perform filtering correctly, regardless of how fast the Enter key is pressed.

Steps to reproduce

  1. Go to https://tom-select.js.org/examples/
  2. Scroll to the final dropdown
  3. Clear out California and Wyoming from the combobox
  4. Type the letter c
  5. Press Enter quickly, before the dropdown has been filtered
  6. Alabama will be added to the combobox

Additional context

  • OS: [Windows]
  • Browser [chrome, firefox, edge]

Although the example given uses a select multiple, this bug also occurs in dropdowns where only a single option can be chosen.