Skip to content

Commit

Permalink
Use same option_create config for autocompelte with remote data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas De Keukelaere committed Oct 17, 2024
1 parent c9bf5ee commit 28a1669
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Autocomplete/assets/dist/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ _default_1_instances = new WeakSet(), _default_1_getCommonConfig = function _def
return `<div class="no-results">${this.noResultsFoundTextValue}</div>`;
},
option_create: (data, escapeData) => {
return `<div class="create">${this.createOptionTextValue} <strong>${escapeData(data.input)}</strong>&hellip;</div>`;
return `<div class="create">${this.createOptionTextValue.replace('%placeholder%', `<strong>${escapeData(data.input)}</strong>`)}</div>`;
},
},
preload: this.preload,
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/assets/src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default class extends Controller {
return `<div class="no-results">${this.noResultsFoundTextValue}</div>`;
},
option_create: (data: TomOption, escapeData: typeof escape_html): string => {
return `<div class="create">${this.createOptionTextValue} <strong>${escapeData(data.input)}</strong>&hellip;</div>`;
return `<div class="create">${this.createOptionTextValue.replace('%placeholder%', `<strong>${escapeData(data.input)}</strong>`)}</div>`;
},
},
preload: this.preload,
Expand Down

0 comments on commit 28a1669

Please sign in to comment.