Gatsby: [www] Open search form with keyboard shortcut

Created on 19 Jan 2018  路  5Comments  路  Source: gatsbyjs/gatsby

Add keyboard shortcut / to open the search form on gatsbyjs.org.

Ref: https://github.com/gatsbyjs/gatsby/pull/3421#issuecomment-358740434

All 5 comments

Is this convention? Some browsers default / to Find. (like Firefox)

Currently, it's the first tab target, which generally a good a11y practice.

Oh hmmm good point. I've done it on a web app before and it was great but perhaps it's not worth doing it here.

Maybe we could look at how GitHub handles it? On the issues page / opens Firefox's built in 'Find in page' control, but for other browsers it focusses the issue search box.

We could also use a key that doesn't conflict with any existing browser shortcuts. Check out the full range of GitHub shortcuts with ?.

Yeah, they use s which seems reasonable. We could also use copy their "go to" commands e.g. gd is go to docs, gp is go to package search page (once that's built that is :-)). Which would be fun too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magicly picture magicly  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

hobochild picture hobochild  路  3Comments

ghost picture ghost  路  3Comments

timbrandin picture timbrandin  路  3Comments