Added custom hotkey support

This commit is contained in:
Robin Schneider
2021-09-11 12:42:57 +02:00
parent 6b54eedae7
commit 584f2b4b32
3 changed files with 11 additions and 2 deletions

View File

@@ -15,10 +15,16 @@
<script>
export default {
name: "SearchInput",
props: ["value"],
props: {
value: String,
hotkey: {
type: String,
default: "/"
}
},
mounted() {
this._keyListener = function (event) {
if (event.key === "/") {
if (event.key === this.hotkey) {
event.preventDefault();
this.focus();
}