graphql.github.io
graphql.github.io copied to clipboard
Focus the search bar on "/" keypress
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
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.
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
This would be nice addition. Cmd+K is something Docusaurus sites come with.
@igbominadeveloper are you still aiming to implement it? if yes, can you please rebase and open a new PR? Thanks!
@igbominadeveloper are you still aiming to implement it? if yes, can you please rebase and open a new PR? Thanks!
@Urigo Reimplemented it here