Semantic-ui: [Dropdown][Search Selection] Match any part of the string

Created on 2 Dec 2015  路  7Comments  路  Source: Semantic-Org/Semantic-UI

This is a feature request.

Currently, when you search in a dropdown it matches the string from the beginning only. You can't search for something in the middle of the string (LIKE% matches, %LIKE% doesn't). For example, if you want to search a dropdown of users and you type their last name but no results are found unless you type the first name first.

Example

http://semantic-ui.com/modules/dropdown.html

What happens

  • Go to the country dropdown search select.
  • Type states
  • No results found.

    What's expected

  • Go to the country dropdown search select.

  • Type states
  • United States shown in the list as a match.

    Example of expected

jQuery's autocomplete does this and there is an example here: https://jqueryui.com/autocomplete/#combobox

Confirmed Bug

Most helpful comment

Under Settings (tab), Additional Settings:

http://semantic-ui.com/modules/dropdown.html#additional-settings

fullTextSearch : Whether search selections should look for string match anywhere in string.

$('.ui.dropdown').dropdown({ fullTextSearch: true });

Hope that helps.

All 7 comments

Under Settings (tab), Additional Settings:

http://semantic-ui.com/modules/dropdown.html#additional-settings

fullTextSearch : Whether search selections should look for string match anywhere in string.

$('.ui.dropdown').dropdown({ fullTextSearch: true });

Hope that helps.

That works. Didn't see that in the docs. Thank you. :)

fullTextSearch=true doesn't appear to do a substring match for the query-string in the items. instead, it appears to match in order occurrence of all characters of the query-string in the item with any other characters interspersed (example : query-string 'temp' will match 'mytestmatchpick' and 'mytemperature' ).

Any idea how to restrict to a strict substing match behavior ?

I can confirm @duapraveen problem, we really need a fix for this

fullTextSearch=exact seems to do what i needed - looks for the query-string anywhere in the strings.

http://semantic-ui.com/modules/dropdown.html#additional-settings

Thanks @duapraveen for your response but that didn't work for me in search

http://semantic-ui.com/modules/search.html

Could you help in this ? I know it's out of this issue context but it's the same behavior in search, that's what got me here.

Gracias kapo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mllamazares picture mllamazares  路  3Comments

ghost picture ghost  路  3Comments

playgithub picture playgithub  路  3Comments

kntmrkm picture kntmrkm  路  3Comments

iPaoo picture iPaoo  路  3Comments