Fix 'clear shortcut' button (probably)

This commit is contained in:
Tamius Han 2019-10-22 01:40:38 +02:00
parent 3768575bad
commit 4a9ef1f9db

View File

@ -7,7 +7,7 @@
@focus="initiateKeypress"
@keyup="processKeyup"
/>
<span v-if="shortcut" @click="$emit('set-shortcut')">(Clear shortcut)</span>
<span v-if="shortcut" @click="clearShortcut()">(Clear shortcut)</span>
</div>
</template>
@ -51,6 +51,11 @@ export default {
this.shortcutText = KeyboardShortcutParser.parseShortcut(shortcut);
}
this.waitingForPress = false;
},
clearShortcut() {
this.shortcutText = '[click to add shortcut]';
this.shortcut = undefined;
this.$emit('set-shortcut');
}
}
}