hackerweb icon indicating copy to clipboard operation
hackerweb copied to clipboard

Add keyboard navigation

Open sbdchd opened this issue 10 years ago • 3 comments

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

sbdchd avatar Feb 09 '16 15:02 sbdchd

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)

sbdchd avatar Feb 16 '16 22:02 sbdchd

@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 :stuck_out_tongue:

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

cheeaun avatar Feb 17 '16 03:02 cheeaun

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.

sbdchd avatar Feb 19 '16 21:02 sbdchd