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

disable_search option breaks conventional 'highlight option as you type' behavior #2948

Open blasthaus opened 6 years ago

blasthaus commented 6 years ago

When using the option, disable_search = 1, the conventional way of 'as you type, any matching option will get highlighted in the options list' does not function and in fact is broken.

Steps to reproduce

Tell us how to reproduce this issue.

  1. initialize chosen with the option "disable_search : 1"

  2. Make a select tag with options A,B,C,P

  3. Click on the select box and start by typing B and B will not be highlighted. Type A and A will not be highlighted, etc.

You can use https://jsfiddle.net/j7k727cp/ and change the js to: $(".chosen-select").chosen({disable_search:1});

Expected behavior

As you begin to type a word which matches of the options, the option should be highlighted so you can quickly select it.

Actual behavior

Nothing happens when you type and occasionally random options are highlighted.

Environment

-chosen 1.8.3

Touth commented 6 years ago

Default SELECT also highlight when you press space key.