harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.85k stars 4.1k forks source link

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

Closed stephen-terrones closed 1 year ago

stephen-terrones commented 1 year ago

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

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.

tjschuck commented 1 year ago

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