Where Is Waldo
Where is Waldo is a search bar with suggestions based on the list you provide.
Usage
import search from 'where-is-waldo';
//...
var mySearchBar = Searchbar({
rootElement: ".js-searchBar", // parent selector
list: myListOfThings, // list of things you want to suggest
handleSuggestionClick: function (e) { // callback function
},
handleFormSubmit: function(e) { // callback function
}
});
mySearchBar.init();
Update the list
If you need to reflect changes in the list of suggestions, you can re-assign a new filtered list :
mySearchBar.setList(myFilteredListOfThings);