mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-01-13 09:28:38 +01:00
Fix #171: empty search opens first item
This commit is contained in:
parent
168810d76f
commit
c1b5f6adab
@ -6,8 +6,8 @@
|
|||||||
ref="search"
|
ref="search"
|
||||||
:value="value"
|
:value="value"
|
||||||
@input="search($event.target.value)"
|
@input="search($event.target.value)"
|
||||||
@keyup.enter.exact="$emit('search-open')"
|
@keyup.enter.exact="open()"
|
||||||
@keyup.alt.enter="$emit('search-open', '_blank')"
|
@keyup.alt.enter="open('_blank')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -37,6 +37,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
open: function (target = null) {
|
||||||
|
if (!this.$refs.search.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$emit("search-open", target);
|
||||||
|
},
|
||||||
focus: function () {
|
focus: function () {
|
||||||
this.$emit("search-focus");
|
this.$emit("search-focus");
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user