woocommerce / selectWoo

selectWoo is a fork of select2 with improved accessibility.
MIT License
124 stars 27 forks source link

fixes- State dropdown not showing exact match #20

Open nishitlangaliya opened 6 years ago

nishitlangaliya commented 6 years ago

Fixes: State dropdown not showing exact match ref # https://github.com/woocommerce/woocommerce/pull/20605

As per suggestion PR done

This pull request includes a

The following changes were made

-

-

If this is related to an existing ticket, include a link to it as well.

claudiulodro commented 6 years ago

Hi. Thanks for the effort.

This feature is not going to be so straightforward.

This change does show Washington as the first result when typing "wa" into the checkout, but it will not show any states that don't start with "wa" (e.g. Delaware, Iowa):

screen shot 2018-07-05 at 12 23 39 pm

Also, this means that you cannot now find Washington with the search "ton", "ashington", etc.

What it needs is to show Washington as the first result when searching for "wa" and all of the other results need to be present in the same order they were before:

screen shot 2018-07-05 at 12 35 18 pm

It's a much trickier issue, and I don't think we can solve it until we define what the correct algorithm should be.