Skip to content

Added type check to keyboard navigation #182

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

Merged
merged 5 commits into from
Jan 5, 2025

Conversation

christianfuttrup
Copy link
Contributor

@christianfuttrup christianfuttrup commented Jan 4, 2025

Description

This pull request aims to ensure that the switch cases don't accept a random string from the KeyboardEvent but rather only the ones that we expect. Furthermore, each case in the switch statement doesn't handle preventDefault anymore; it has been moved to all cases that meet the keys we expect.

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe): Slight refactoring to secure better typing to prevent accidentally introduced misbehavior in the future.

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

#140 (same context)

Copy link
Collaborator

@psychlone77 psychlone77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍. Thank you for your contribution.

@Mathys-Gasnier Mathys-Gasnier merged commit 55a9225 into technoph1le:main Jan 5, 2025
1 check 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.

4 participants