Skip to content

Hide not matching results #658

@auchri

Description

@auchri

Hi,

thanks for the great library!

I've tried the example from the readme:

$('#autocomplete').autocomplete({ lookup: function (query, done) { // Do Ajax call or lookup locally, when done, // call the callback and pass your results: var result = { suggestions: [ { "value": "United Arab Emirates", "data": "AE" }, { "value": "United Kingdom", "data": "UK" }, { "value": "United States", "data": "US" } ] }; done(result); }, onSelect: function (suggestion) { alert('You selected: ' + suggestion.value + ', ' + suggestion.data); } });

However, if I enter for example Kingdom, the other two suggestions (which have nothing to do with the query) are still visible.
Is there an option available to hide these invalid suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions