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

add basic keyboard support #202

Merged
merged 3 commits into from
Feb 20, 2021
Merged

add basic keyboard support #202

merged 3 commits into from
Feb 20, 2021

Conversation

tborychowski
Copy link
Contributor

This adds basic keyboard support on the search results page:

  • ArrowUp or k - focus previous result
  • ArrowDown or j - focus next result
  • / focus search box

Because this just focuses links in the search result items hitting Enter (or ctrl/cmd + Enter) when an item is focused - will open the search result (because the link is already focused and this is browser's default behaviour).

@benbusby
Copy link
Owner

Thanks for implementing this, I'm definitely a fan.

One issue though -- the j and k navigation is still active when the search input is focused, so typing either letter triggers the navigation action rather than modifying the query with the new letter. Once that's been fixed I think this should be good to go.

@tborychowski
Copy link
Contributor Author

Ha! Sorry about that! :-)
That's the one-man testing 😛
Will fix later today.

@tborychowski
Copy link
Contributor Author

@benbusby should be good now. Thanks!

Copy link
Owner

@benbusby benbusby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! Looks great.

@benbusby benbusby merged commit 38f1601 into benbusby:develop Feb 20, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants