harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.

Home Page:http://harvesthq.github.io/chosen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEARCH BUG: Number search does not return obvious correct value.

stephen-terrones opened this issue · comments

Steps to reproduce

FOR THIS SET:

<li class="active-result" data-option-array-index="0">TEST - AA - 001</li>
<li class="active-result" data-option-array-index="1">TEST - BB - 002</li>
<li class="active-result" data-option-array-index="2">TEST - CC - 003</li>
<li class="active-result" data-option-array-index="3">TEST - AD - 011</li>
<li class="active-result" data-option-array-index="4">TEST - AE - 022</li>
<li class="active-result" data-option-array-index="5">TEST - AF - 033</li>

SEARCH FOR: 33

Expected behavior

It should display the option for index 5; with the value TEST - AF - 033

Actual behavior

"No results match 33"

Environment

  • Chosen Version: at least 1.8.3 to current

  • jQuery or Prototype Version: 3.5.1

  • Browser and Version: chrome current

  • OS and Version: windows 11 current

Additional information

If the following value is added to the set:
<li class="active-result" data-option-array-index="6">TEST - AG - 330</li>

Then searching for 33 will return this option, but will still omit index 5 with the number 033 in the text.

If you add the { search_contains: true } option, it should match like you want. Docs here.