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.hits = [];
|
||||
this.searchTerms = '';
|
||||
var search_field = document.getElementById('search-field');
|
||||
search_field.focus();
|
||||
this.$refs.search.focus();
|
||||
},
|
||||
run_search() {
|
||||
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>
|
||||
|
||||
<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-for="hit in hits">
|
||||
|
|
Loading…
Reference in a new issue