The SearchStax Site Search solution's Input widget provides a search input field with autosuggest and autocomplete capabilities.
Usage
searchstax.addSearchInputWidget("searchstax-input-container", {
suggestAfterMinChars: 3,
});
-
suggestAfterMinChars– default 3. The number of characters needed before autosuggest triggers. -
hooks.beforeAutosuggest– a callback function that runs before autosuggest fires. The autosuggestProps are passed as a property so you can modify them. If you pass the modified properties along, the search executes with those changes. If you return null, the event cancels and the search doesn't fire. -
hooks.afterAutosuggest– a callback function that runs after autosuggest has values but before rendering. It must return the same data type, but you can modify the values. -
templates– template override. See examples in searchstax-ux-js.
Example
See the full example at searchstax-ux-js.