Fix ft-input from rewriting itself when search suggestions are active
This commit is contained in:
parent
6e5a1a1085
commit
0428891773
|
@ -49,6 +49,7 @@ export default Vue.extend({
|
|||
},
|
||||
mounted: function () {
|
||||
this.id = this._uid
|
||||
this.inputData = this.value
|
||||
|
||||
setTimeout(this.addListener, 200)
|
||||
},
|
||||
|
@ -57,9 +58,8 @@ export default Vue.extend({
|
|||
this.$emit('click', this.inputData)
|
||||
},
|
||||
|
||||
handleInput: function (input) {
|
||||
this.inputData = input
|
||||
this.$emit('input', input)
|
||||
handleInput: function () {
|
||||
this.$emit('input', this.inputData)
|
||||
},
|
||||
|
||||
addListener: function () {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<input
|
||||
:id="id"
|
||||
:list="idDataList"
|
||||
:value="value"
|
||||
v-model="inputData"
|
||||
class="ft-input"
|
||||
type="text"
|
||||
:placeholder="placeholder"
|
||||
|
|
|
@ -17,7 +17,6 @@ export default Vue.extend({
|
|||
component: this,
|
||||
windowWidth: 0,
|
||||
showFilters: false,
|
||||
searchValue: '',
|
||||
searchSuggestionsDataList: []
|
||||
}
|
||||
},
|
||||
|
@ -126,20 +125,17 @@ export default Vue.extend({
|
|||
getSearchSuggestionsLocal: function (query) {
|
||||
if (query === '') {
|
||||
this.searchSuggestionsDataList = []
|
||||
this.searchValue = ''
|
||||
return
|
||||
}
|
||||
|
||||
ytSuggest(query).then((results) => {
|
||||
this.searchSuggestionsDataList = results
|
||||
this.searchValue = query
|
||||
})
|
||||
},
|
||||
|
||||
getSearchSuggestionsInvidious: function (query) {
|
||||
if (query === '') {
|
||||
this.searchSuggestionsDataList = []
|
||||
this.searchValue = ''
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -153,7 +149,6 @@ export default Vue.extend({
|
|||
|
||||
this.$store.dispatch('invidiousAPICall', searchPayload).then((results) => {
|
||||
this.searchSuggestionsDataList = results.suggestions
|
||||
this.searchValue = query
|
||||
}).error((err) => {
|
||||
console.log(err)
|
||||
if (this.backendFallback) {
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
class="searchInput"
|
||||
:is-search="true"
|
||||
:data-list="searchSuggestionsDataList"
|
||||
:value="searchValue"
|
||||
@input="getSearchSuggestionsDebounce"
|
||||
@click="goToSearch"
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue