switched 2 inputs

This commit is contained in:
Luca Haid
2024-11-20 12:26:22 +00:00
parent b36f8108ad
commit 5bb51fd676
5 changed files with 118 additions and 46 deletions
@@ -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 {
+3 -1
View File
@@ -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')
}
}