Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.07k stars 4.96k forks source link

[Search] Should filter remote content via a setting #6573

Open faheel opened 5 years ago

faheel commented 5 years ago

Steps

  1. Create a standard search element as described in the docs.
    <div class="ui search">
     <input class="prompt" placeholder="Search" type="text">
     <div class="results"></div>
    </div>
  2. Set the url in the apiSettings to an API's endpoint from where JSON data (in the same format as mentioned in the docs) will be received.
    $(document).ready(function () {
     $('.ui.search').search({
       apiSettings: {
         url: 'https://example.com/some/api/endpoint'
       },
       filterRemoteData: true,
       showNoResults: true,    // or false, not important
       fullTextSearch: 'exact' // or true, not important
     });
    }
  3. Type anything in the search input field.

Expected Result

The search results should have been filtered on the client-side based on what's typed in the input field.

Actual Result

All of the remote content is listed in the results, no matter what is typed in the search input. No filtering is done by Semantic on the client-side even though filterRemoteData: true is set as mentioned in the docs for dropdown. The same should work for the standard search element too.

Version

2.3.3

Testcase

(Will set up a sample JSFiddle later as my project isn't public yet.)

y0hami commented 5 years ago

Try recreating the issue using this JSFiddle then it doesn't harm your private project.