Skip to content

Focus the search bar on "/" keypress #871

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

Closed
wants to merge 1 commit into from
Closed

Focus the search bar on "/" keypress #871

wants to merge 1 commit into from

Conversation

igbominadeveloper
Copy link
Contributor

What does this PR do?

This PR adds functionality to the site to focus the search input when a user presses the '/' key

Background context

Because the nav bar on the site is not sticky, whenever users need to perform a site-wide search, it would require a scroll back to the top of the site page they are on and then click on the search input before they can type, now, all it takes is pressing the '/' key on the keyboard and it is focused

What are relevant issue(s)?

N/A

Screenshots

https://www.loom.com/share/71c65b520abc4f09ae61ce22dc8c7a4d

@carolstran
Copy link
Member

Hey hey 👋🏼 FYI - The site was recently migrated to Gatsby (#938) so in order for this to be merged, you'd need to update/rebase the branch and fix the conflicts.

Also, out of curiosity, do you have any documentation on using the / key to trigger the search functionality? I'm not familiar with that practice.

@igbominadeveloper
Copy link
Contributor Author

Hey hey 👋🏼 FYI - The site was recently migrated to Gatsby (#938) so in order for this to be merged, you'd need to update/rebase the branch and fix the conflicts.

Also, out of curiosity, do you have any documentation on using the / key to trigger the search functionality? I'm not familiar with that practice.

I first saw it here on github.com and laravel.com/docs @carolstran

@saihaj
Copy link
Member

saihaj commented Apr 15, 2021

This would be nice addition. Cmd+K is something Docusaurus sites come with.

@Urigo
Copy link
Contributor

Urigo commented Apr 9, 2023

@igbominadeveloper are you still aiming to implement it?
if yes, can you please rebase and open a new PR?
Thanks!

@igbominadeveloper
Copy link
Contributor Author

@igbominadeveloper are you still aiming to implement it?
if yes, can you please rebase and open a new PR?
Thanks!

@Urigo Reimplemented it here

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

Successfully merging this pull request may close these issues.

4 participants