diff --git a/webroot/js/autocomplete.js b/webroot/js/autocomplete.js index 52d81c7..368fec1 100644 --- a/webroot/js/autocomplete.js +++ b/webroot/js/autocomplete.js @@ -13,6 +13,14 @@ export default { activeBtn: { type: Boolean, default: true + }, + renderBtn: { + type: Boolean, + default: true + }, + preInfo: { + type: String, + default: '' } }, inject: ['txt', 'api'], @@ -82,13 +90,22 @@ export default { this.val = ui.item.identifier; this.item = ui.item; this.search = `${ui.item.label} (${ui.item.value})`; - $(`#${this.toKebabCase(this.action)}-btn`).prop('disabled', false).focus(); - return false; + if(this.renderBtn) { + $(`#${this.toKebabCase(this.action)}-btn`).prop('disabled', false).focus(); + } else { + // Since we are not rendering any button we will trigger the search + this.performAction() + } }, }) }, template: /*html*/`
+
+ + + +
-
+