New approach to focus search field
This commit is contained in:
parent
61fd14427d
commit
a9ef91b214
|
@ -24,8 +24,7 @@ var app = new Vue({
|
||||||
this.new_depicts.push(hit);
|
this.new_depicts.push(hit);
|
||||||
this.hits = [];
|
this.hits = [];
|
||||||
this.searchTerms = '';
|
this.searchTerms = '';
|
||||||
var search_field = document.getElementById('search-field');
|
this.$refs.search.focus();
|
||||||
search_field.focus();
|
|
||||||
},
|
},
|
||||||
run_search() {
|
run_search() {
|
||||||
var terms = this.searchTerms;
|
var terms = this.searchTerms;
|
||||||
|
|
|
@ -152,7 +152,7 @@ span.description { color: rgb(96, 96, 96); }
|
||||||
|
|
||||||
<button type="submit" v-if="new_depicts.length" class="btn btn-primary">add these to painting on Wikidata</button>
|
<button type="submit" v-if="new_depicts.length" class="btn btn-primary">add these to painting on Wikidata</button>
|
||||||
|
|
||||||
<input class="form-control-lg my-2 w-100" autofocus autocomplete="off" v-model.trim="searchTerms" id="search-field" @input="search" />
|
<input class="form-control-lg my-2 w-100" autofocus autocomplete="off" v-model.trim="searchTerms" ref="search" @input="search" />
|
||||||
|
|
||||||
<div v-if="hits.length" id="item-list">
|
<div v-if="hits.length" id="item-list">
|
||||||
<div v-for="hit in hits">
|
<div v-for="hit in hits">
|
||||||
|
|
Loading…
Reference in a new issue