mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-12-25 16:19:04 +01:00
Fix #171: empty search opens first item
This commit is contained in:
parent
168810d76f
commit
c1b5f6adab
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user