sindresorhus/refined-github

Make card navigation via j/k smooth? #3943

ThomsonTan posted onGitHub

<!-- 1. Make sure your requested feature makes sense for Refined GitHub: https://github.com/sindresorhus/refined-github/issues/2960 2. Include a full URL where the feature should appear. -->

j/k could be used as keyboard shortcut to move focused card in issue or pull request page which is convenient, but navigation is not smooth (no moving animation). Is it possible to make the navigation smooth like window.scroll({behavior: 'smooth'});?


This can already be achieved globally with html {scroll-behavior: smooth}

gif

I'm not sure whether we should include this because people are pretty sensitive about their scroll behavior.

posted by fregante about 4 years ago

Thanks for the pointer. It seems this global CSS style doesn't work well with j/k navigation like in this page. It indeed triggers smooth scrolling but the focused card could miss go to the top (I guess smooth scrolling interferes with some navigation setting in JavsScript).

I'd agree that this might not be expected by others, I'll try add this to my local script.

posted by ThomsonTan about 4 years ago

the focused card could miss go to the top

I don't understand what you mean

posted by fregante about 4 years ago

Sorry for the confusion. I meant the focused card would lose focus for any mouse click on the area out side the car, then j keyboard shortcut will start navigation from the top. This seems a little annoy.

Is there a way to auto-focus the card which was clicked, then the following j/k command starts navigation from the clicked card?

posted by ThomsonTan almost 4 years ago

I meant the focused card would lose focus for any mouse click on the area out side the car

That's just how j/k has been implemented by GitHub and making it smooth would not affect that.

Closing this issue since smoothing can be achieved via CSS, if desired.

posted by fregante almost 4 years ago

Fund this Issue

$0.00
Funded

Pull requests