Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dropdown][Search Selection] Match any part of the string #3424

Closed
adrazich opened this issue Dec 2, 2015 · 9 comments
Closed

[Dropdown][Search Selection] Match any part of the string #3424

adrazich opened this issue Dec 2, 2015 · 9 comments
Milestone

Comments

@adrazich
Copy link

adrazich commented Dec 2, 2015

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

@kmd1970
Copy link

kmd1970 commented Dec 3, 2015

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.

@adrazich
Copy link
Author

adrazich commented Dec 3, 2015

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

@adrazich adrazich closed this as completed Dec 3, 2015
@duapraveen
Copy link

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 ?

@basselAhmed
Copy link

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

@duapraveen
Copy link

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

@basselAhmed
Copy link

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.

rminnett added a commit to rminnett/Semantic-UI that referenced this issue Oct 14, 2016
Dropdown fullTextSearch=exact was only implemented for the text search, not the value search. The value term was using a fuzzy match even with fullTextSearch=exact.
@jlukic jlukic added this to the 2.2.8 milestone Dec 29, 2016
jlukic added a commit that referenced this issue Dec 29, 2016
@NahuelKliphan
Copy link

Gracias kapo

@Jayashree-panda
Copy link

I am facing the same issue with react semantic ui. @duapraveen @kmd1970 Can you please help me with that.

@Shubhdeep12
Copy link

Shubhdeep12 commented Feb 1, 2023

@Jayashree-panda if you are using semantic-ui react maybe this can help you Semantic-Org/Semantic-UI-React#3932 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants