Skip to content

Commit

Permalink
fix: avoid runtime error by ignoring keyless keyup events (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikg committed Aug 22, 2022
1 parent f0c409f commit ebb3a7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit ebb3a7e

Please sign in to comment.