fix: keyboard shortcut to confirm prompts (#2932)
parent
62f0dfb302
commit
ff9502ff34
|
@ -62,17 +62,16 @@ export default {
|
||||||
window.addEventListener("keydown", (event) => {
|
window.addEventListener("keydown", (event) => {
|
||||||
if (this.currentPrompt == null) return;
|
if (this.currentPrompt == null) return;
|
||||||
|
|
||||||
let prompt = this.$refs.currentComponent;
|
const promptName = this.currentPrompt.prompt;
|
||||||
|
const prompt = this.$refs[promptName];
|
||||||
|
|
||||||
// Esc!
|
if (event.code === "Escape") {
|
||||||
if (event.keyCode === 27) {
|
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
this.$store.commit("closeHovers");
|
this.$store.commit("closeHovers");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enter
|
if (event.code === "Enter") {
|
||||||
if (event.keyCode == 13) {
|
switch (promptName) {
|
||||||
switch (this.currentPrompt.prompt) {
|
|
||||||
case "delete":
|
case "delete":
|
||||||
prompt.submit();
|
prompt.submit();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue