Skip to content

Commit

Permalink
Escape key closes settings manager
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Jul 19, 2021
1 parent 5c43a4d commit 3b0d289
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/SettingsManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
})
);
});
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
closeSettingsManager();
}
});
</script>

{#if visible}
Expand All @@ -92,9 +98,7 @@
})
.filter((setting) => setting.name
.toLowerCase()
.includes(
search
) || setting.description
.includes(search) || setting.description
.toLowerCase()
.includes(search)) as setting}
<div class="setting">
Expand Down

0 comments on commit 3b0d289

Please sign in to comment.