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

fix: avoid runtime error by ignoring keyless keyup events #417

Merged
merged 1 commit into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-seas-rule.md
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

ignore keyup events without key in inspector
4 changes: 2 additions & 2 deletions packages/vite-plugin-svelte/src/ui/inspector/Inspector.svelte
Expand Up @@ -99,7 +99,7 @@
}

function keydown(event) {
if (event.repeat || event.key === undefined) {
if (event.repeat || event.key == null) {
return;
}

Expand All @@ -112,7 +112,7 @@
}

function keyup(event) {
if (event.repeat) {
if (event.repeat || event.key == null) {
return;
}
const k = event.key.toLowerCase();
Expand Down