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 keyboard navigation #52

Open
sbdchd opened this issue Feb 9, 2016 · 3 comments
Open

Add keyboard navigation #52

sbdchd opened this issue Feb 9, 2016 · 3 comments

Comments

@sbdchd
Copy link

sbdchd commented Feb 9, 2016

I think it would be convenient to be able to use the keyboard to navigate through posts.

@sbdchd
Copy link
Author

sbdchd commented Feb 16, 2016

I made a basic implementation of keyboard navigation, which works for the main page (not the comments).

See here.

Suggestions are much appreciated.

Keyboard Nav
j - move down
k - move up

o - open story
c - open comments page

<backspace> - go to previous page (this is just normal browser behavior)

@cheeaun
Copy link
Owner

cheeaun commented Feb 17, 2016

@sbdchd wow, that's really cool! I think you need e.preventDefault for the key presses, I enabled 'Search for text when I start typing' on my Firefox 😛

I'll further look at this during the weekend and see what I can do.

@sbdchd
Copy link
Author

sbdchd commented Feb 19, 2016

There seems to be an issue with this setup triggering more.

Sometimes, after more is triggered, the posts will become duplicated on the page.

In this case, the page will add on the items 31-60 multiple times to the current 1-30 posts.

When triggering more by hand this doesn't happen.

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

No branches or pull requests

2 participants