Skip to content

Commit

Permalink
fix: keyboard shortcut to confirm prompts (#2932)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShlomoCode committed Jan 30, 2024
1 parent 62f0dfb commit ff9502f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/src/components/prompts/Prompts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,16 @@ export default {
window.addEventListener("keydown", (event) => {
if (this.currentPrompt == null) return;
let prompt = this.$refs.currentComponent;
const promptName = this.currentPrompt.prompt;
const prompt = this.$refs[promptName];
// Esc!
if (event.keyCode === 27) {
if (event.code === "Escape") {
event.stopImmediatePropagation();
this.$store.commit("closeHovers");
}
// Enter
if (event.keyCode == 13) {
switch (this.currentPrompt.prompt) {
if (event.code === "Enter") {
switch (promptName) {
case "delete":
prompt.submit();
break;
Expand Down

0 comments on commit ff9502f

Please sign in to comment.