Fix #171: empty search opens first item

This commit is contained in:
Bastien Wirtz 2020-12-19 15:59:01 -08:00
parent 168810d76f
commit c1b5f6adab

View File

@ -6,8 +6,8 @@
ref="search"
:value="value"
@input="search($event.target.value)"
@keyup.enter.exact="$emit('search-open')"
@keyup.alt.enter="$emit('search-open', '_blank')"
@keyup.enter.exact="open()"
@keyup.alt.enter="open('_blank')"
/>
</div>
</template>
@ -37,6 +37,12 @@ export default {
}
},
methods: {
open: function (target = null) {
if (!this.$refs.search.value) {
return;
}
this.$emit("search-open", target);
},
focus: function () {
this.$emit("search-focus");
this.$nextTick(() => {