Skip to content

Commit

Permalink
Fix autocomplete unique id
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 3, 2024
1 parent 9c121b4 commit 864a2aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webroot/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default {
},
mounted(el) {
const input = $(this.$el).find(`#${this.toKebabCase(this.action)}-input`);
const action = this.action
this.url = `${this.api.find}?co=${this.api.co}&mode=${this.api.mode}&page=${this.page}&limit=${this.limit}`
input.autocomplete({
source: ( request, response ) => {
Expand All @@ -70,11 +71,11 @@ export default {
term: request.term
},
success: function (data) {
$(`#autocomplete-search-container-${this.action} .co-loading-mini`).hide();
$(`#autocomplete-search-container-${action} .co-loading-mini`).hide();
response( data );
},
error: function(data) {
$(`#autocomplete-search-container-${this.action} .co-loading-mini`).hide();
$(`#autocomplete-search-container-${action} .co-loading-mini`).hide();
console.log('Autocomplete ajax error:', data)
generateFlash('Find action failed', 'error');
}
Expand Down

0 comments on commit 864a2aa

Please sign in to comment.