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

feat: keyboard status navigation with j/k #2739

Merged
merged 8 commits into from
May 31, 2024

Conversation

shuuji3
Copy link
Member

@shuuji3 shuuji3 commented Apr 1, 2024

resolves j/k navigation part of #1858

Copy link

stackblitz bot commented Apr 1, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 0b9b880
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/6659657ae16f86000834d91e

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 0b9b880
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/6659657a591a120008e4f8ff
😎 Deploy Preview https://deploy-preview-2739--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shuuji3 shuuji3 changed the title feat: keyboard status navigation with j/k feat: keyboard status navigation with j/k Apr 1, 2024
@shuuji3 shuuji3 force-pushed the shuuji3/feat/keyboard-status-navigation-jk branch from b50ce2b to 08f847f Compare April 7, 2024 15:46
@shuuji3 shuuji3 force-pushed the shuuji3/feat/keyboard-status-navigation-jk branch 2 times, most recently from 3746e16 to 9d327f1 Compare April 21, 2024 12:13
@shuuji3
Copy link
Member Author

shuuji3 commented Apr 22, 2024

This implementation is working well if we disable the experimental virtual scrolling. When enabled and a post has a large height, the next post is not loaded until it is on-screen. As a result, this keyboard navigation code fails to find the next post to focus on and stack to the last post or is forced to go to the top post.

We are using DynamicScroller (https://github.com/Akryum/vue-virtual-scroller/blob/master/packages/vue-virtual-scroller/README.md#dynamicscroller) but it has little option to customize so I'm not sure how to fix this issue.

I'll disable this keyboard shortcut when the virtual scroller is enabled. But that means most users cannot use it as it is enabled by default.

@shuuji3
Copy link
Member Author

shuuji3 commented Apr 22, 2024

Disabled this feature when "Virtual Scrolling" is enabled and add instructions to do so in the shortcut help dialog.

image

@shuuji3 shuuji3 marked this pull request as ready for review April 22, 2024 04:29
@shuuji3 shuuji3 force-pushed the shuuji3/feat/keyboard-status-navigation-jk branch from aa171a8 to 2d53047 Compare May 29, 2024 03:28
@patak-dev
Copy link
Member

I'm not sure about adding j/k only when virtual scrolling is disabled. It may push users to disable it and we could get performance reports later on. Maybe we could wait to see if a way to have it always enabled comes up?

@shuuji3
Copy link
Member Author

shuuji3 commented May 31, 2024

Right, that's not an ideal situation. OK, let's revert the message to encourage disabling virtual scrolling and seek a solution.

@patak-dev patak-dev added this pull request to the merge queue May 31, 2024
Merged via the queue into main with commit 97ce2fc May 31, 2024
15 checks passed
@patak-dev patak-dev deleted the shuuji3/feat/keyboard-status-navigation-jk branch May 31, 2024 10:37
@shuuji3
Copy link
Member Author

shuuji3 commented May 31, 2024

Thanks!

shuuji3 added a commit that referenced this pull request Oct 21, 2024
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.

2 participants