Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitting Enter/Return on search form does nothing #158

Open
atn38 opened this issue Dec 18, 2020 · 2 comments
Open

Hitting Enter/Return on search form does nothing #158

atn38 opened this issue Dec 18, 2020 · 2 comments

Comments

@atn38
Copy link

atn38 commented Dec 18, 2020

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!

@bodinsamuel
Copy link
Contributor

Seems to be the default behaviour of Autocomplete V1 and Docsearch,
any reason why and suggestion on this @francoischalifour?

@francoischalifour
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants