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

Router should not prevent default if meta keys are held down (e.g. Ctrl + Click) #129

Closed
Tracked by #120
lukechu10 opened this issue Jun 27, 2021 · 2 comments · Fixed by #165
Closed
Tracked by #120

Router should not prevent default if meta keys are held down (e.g. Ctrl + Click) #129

lukechu10 opened this issue Jun 27, 2021 · 2 comments · Fixed by #165
Assignees
Labels
A-router Area: router C-bug Category: bug, something isn't working D-easy Difficulty: easy good first issue Good for newcomers

Comments

@lukechu10
Copy link
Collaborator

No description provided.

@lukechu10 lukechu10 mentioned this issue Jun 27, 2021
7 tasks
@lukechu10 lukechu10 added C-bug Category: bug, something isn't working D-easy Difficulty: easy A-router Area: router good first issue Good for newcomers labels Jun 27, 2021
@baile320
Copy link
Contributor

baile320 commented Jul 9, 2021

I can help with this one, it seems like there just needs to be a couple if statements in router.rs where ev.prevent_default() is called, and we'll check whether let meta_key_pressed: bool = ev.clone().unchecked_into::<KeyboardEvent>().meta_key(); is true/false?

@lukechu10
Copy link
Collaborator Author

I can help with this one, it seems like there just needs to be a couple if statements in router.rs where ev.prevent_default() is called, and we'll check whether let meta_key_pressed: bool = ev.clone().unchecked_into::<KeyboardEvent>().meta_key(); is true/false?

Go ahead! There are also a few other meta keys which need to be checked for as well: meta, ctrl, shift and alt. The router in SvelteKit might be a good reference:
https://github.com/sveltejs/kit/blob/8854e2ffc48cf653854828f6ac19b2ce620535a6/packages/kit/src/runtime/client/router.js#L103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-router Area: router C-bug Category: bug, something isn't working D-easy Difficulty: easy good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants