switched 2 inputs
This commit is contained in:
@@ -99,7 +99,7 @@ Vue.component('tt-autocomplete', {
|
||||
|
||||
|
||||
if (this.value && this.apiUrl) {
|
||||
const response = await axios.get(`${this.apiUrl}&autocomplete=1&searchedID=${this.value}`);
|
||||
const response = await axios.get(`${this.apiUrl}${this.apiUrl.includes('?') ? '&' : '?'}autocomplete=1&searchedID=${this.value}`);
|
||||
this.displayValue = response.data[0].text;
|
||||
} else if (this.value) {
|
||||
const selectedItem = this.items.find(item => item.value === this.value);
|
||||
@@ -145,7 +145,6 @@ Vue.component('tt-autocomplete', {
|
||||
|
||||
this.isLoading = true;
|
||||
clearTimeout(this.fetchSuggestionsDebounceTimer);
|
||||
console.log(this.displayValue);
|
||||
|
||||
this.fetchSuggestionsDebounceTimer = setTimeout(() => {
|
||||
setTimeout(async () => {
|
||||
@@ -155,7 +154,7 @@ Vue.component('tt-autocomplete', {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await axios.get(`${this.apiUrl}&autocomplete=1&q=${encodeURIComponent(this.displayValue)}`);
|
||||
const response = await axios.get(`${this.apiUrl}${this.apiUrl.includes('?') ? '&' : '?'}autocomplete=1&q=${encodeURIComponent(this.displayValue)}`);
|
||||
if (response.data?.status === 'error') {
|
||||
this.displayingItems = [];
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,9 @@ Vue.component('tt-modal', {
|
||||
this.$emit('update:show', false)
|
||||
}
|
||||
if (event.key === 'Enter' && this.save) {
|
||||
// only submit
|
||||
if (event.target.tagName === 'TEXTAREA' || event.target.tagName === 'INPUT') {
|
||||
return
|
||||
}
|
||||
this.$emit('submit')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user