LouisMazel/maz-ui

[When searching in a list of countries by country code, wrong result returned][<MazSelect>]

Closed this issue · 3 comments

Describe the bug

I have the below list of 3 items

[
      {
        "valueOption": "eg",
        "labelOption": "Egypt",
        "inputLabel": "Egypt"
      },

      {
        "valueOption": "gy",
        "labelOption": "Guyana",
        "inputLabel": "Guyana"
      },

      {
        "valueOption": "gp",
        "labelOption": "Guadeloupe",
        "inputLabel": "Guadeloupe"
      },
    ],

And here is my mazSelect input
<MazSelect v-model="registrationForm.nationality" name="nationality" :state="v$.nationality.$errors.length ? false : null" :options="nationalityOptions" option-value-key="valueOption" option-label-key="labelOption" option-input-value-key="inputLabel" id="nationality" class="general-select col-12 rounded-0 nafeza-maz-dropdown-selector" search :search-placeholder="$t('global.SEARCH')" :placeholder="$t('register.PERSONAL_INFO_SECTION.NATIONALITY')" > <template #no-results> <div class="no-results-text">{{$t('global.NO_RESULTS_FOUND')}}</div> </template> </MazSelect>

when i start searching by typing: "egyp" it displays the 3 results instead of just displaying Egypt which strongly match the search value

Expected behavior

Show only Egypt country

MazUi version 3.44.3

Hi @hadelnasr,

Because I'm using an algorithm to find similar results to the query. I will increase the threshold of the search function in the next version.

I'll tell you when it's released

@LouisMazel thanks for your fast response
yeah, please and you can take the provided data as an example for your test

v3.45.0 is released