Closed chrisronline closed 3 years ago
I'm having the same problem as described above.
I have a state dropdown. If I type 'p' let's say it would pre-select Pennsylvania, then I erase 'p' and type 'n' afterwards, Pennsylvania would still be pre-selected not considering the ones high scored from my last search (in this case 'n').
Is this a bug? It doesn't seem right to me.
Thanks
I can also reproduce this issue in the Demo site and use the Country Selector example.
closing stale issues older than one year. If this issue was closed in error please message the maintainers. All issues must include a proper title, description, and examples.
Is this intentional? If there are existing options in the list and the user starts typing (assuming the selectize control supports remote loading) and new options are loaded and added into the control, the original match against the existing options remains active even if one of the loaded options is scored higher.
Code flow: https://github.com/brianreavis/selectize.js/blob/master/dist/js/selectize.js#L1120 https://github.com/brianreavis/selectize.js/blob/master/dist/js/selectize.js#L1128
This line of code will keep the previously $activeOption the newly active option even though new options are present (and could potentially have a higher match score) https://github.com/brianreavis/selectize.js/blob/master/dist/js/selectize.js#L1446
Along this note, if I go to the demo site (http://brianreavis.github.io/selectize.js/) and use the 'Email Contacts' and: 1) Focus the selectize control so the items dropdown 2) Brian Revis option is "pre-selected" by default (so hitting the Enter key will select that option) 3) Type: 's' 4) The someone option ranks the highest but the Brian Revis option is still "pre-selected" - this seems like incorrect behavior?