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

Shortcut for search #22

Closed
blenderskool opened this issue Jan 9, 2019 · 3 comments · Fixed by #38
Closed

Shortcut for search #22

blenderskool opened this issue Jan 9, 2019 · 3 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@blenderskool
Copy link
Contributor

As the entire site is mainly built for developers with an amazing design resembling an editor, how about adding a shortcut that can open the search window? Something like CTRL+SHIFT+P would be super helpful when browsing the site through keyboard 🙂

@codediodeio codediodeio added the enhancement New feature or request label Jan 10, 2019
@codediodeio
Copy link
Member

codediodeio commented Jan 10, 2019

I like this and it would be easy to implement in the algolia-button component. We should also bind the the esc key to close the search.

@blenderskool
Copy link
Contributor Author

@codediodeio Can I try working on this?

@codediodeio
Copy link
Member

codediodeio commented Jan 10, 2019

Yes, please do. I think the best approach is to setup hostlisteners here https://github.com/fireship-io/fireship.io/blob/master/components/src/app/algolia/algolia-search/algolia-search.component.ts. Something like:

@HostListener('document:keydown.escape', ['$event']) onSearchClose(event: KeyboardEvent) {
    this.toggle(false)
}

Also, there are existing cypress tests that you can use to validate the integration.

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

Successfully merging a pull request may close this issue.

2 participants