2 <div class="search-bar">
3 <label for="search" class="search-label"></label>
8 @input="$emit('input', $event.target.value.toLowerCase())"
9 @keyup.enter.exact="$emit('search-open')"
10 @keyup.alt.enter="$emit('search-open', '_blank')"
20 this._keyListener = function (event) {
21 if (event.key === "/") {
22 event.preventDefault();
23 this.$emit("search-focus");
24 this.$nextTick(() => {
25 this.$refs.search.focus();
28 if (event.key === "Escape") {
29 this.$refs.search.value = "";
30 this.$refs.search.blur();
31 this.$emit("search-cancel");
34 document.addEventListener("keydown", this._keyListener.bind(this));
37 document.removeEventListener("keydown", this._keyListener);
42 <style lang="scss" scoped></style>