algoliasearch-netlify
algoliasearch-netlify copied to clipboard
Hitting Enter/Return on search form does nothing
Hello Algolia team,
It seems to me that the Algolia front-end bundle does not generate a conventional search results page, and replaces it with the instant search feature. I'm a fan. However, hitting Enter/Return after typing in keywords on search form does nothing, which I suspect might be un-intuitive to users. Is this the desired behavior? For example, I imagine hitting enter could (1) go to the first result or (2) leave a "no results" message.
Thanks!
Seems to be the default behaviour of Autocomplete V1 and Docsearch, any reason why and suggestion on this @francoischalifour?
@atn38 IIUC, you'd like to have the first result selected by default so that hitting Enter redirects to the first link? (In other terms, never have no items selected).
To achieve this, you can use the defaultSelectedItemId option (that'll be called defaultActiveItemId in the next version) set to 0.
If you only wish to catch the submit form event, you can use the onSubmit param.