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: navigate image view with keyboard keys #4116

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Conversation

RoccoSmit
Copy link
Contributor

Issue: #4024

This PR is to allow for navigating between images using the left and right keyboard keys when viewed in the image dialog.

Build decisions:

  • Because the dialog does not have an input the event listener had to be added to document for the keys to fire the events.
  • Due to the listener being on document it is outside of the component scope so the state does not get updated on key pressed. According to this article there are a couple of ways around it. I chose event listener re-registration so that I did not need to keep 2 sets of state in sync (one foe keyboard, one for mouse) and existing functionality could be used.

@RoccoSmit RoccoSmit requested a review from boojack as a code owner November 10, 2024 03:08
@boojack boojack changed the title Navigate image view with keyboard keys feat: navigate image view with keyboard keys Nov 11, 2024
@boojack boojack merged commit 142e97a into usememos:main Nov 11, 2024
2 checks passed
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