diff --git a/webroot/js/autocomplete.js b/webroot/js/autocomplete.js index c86d92f..ae8235a 100644 --- a/webroot/js/autocomplete.js +++ b/webroot/js/autocomplete.js @@ -25,7 +25,7 @@ export default { }, methods: { performAction() { - this.$emit(this.action, this.item); + this.$emit('callback', this.item); }, toKebabCase(str) { return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); @@ -34,6 +34,11 @@ export default { computed: { btnTxt() { return eval(`this.txt.${this.action}`) ?? eval(`this.txt.${this.icon}`) + }, + isBtnDisabled() { + // The minimum length that i start search is 3. So we only enable the button when + // the input text value has at least three characters + return this.activeBtn || (this.search.length < 3) } }, mounted(el) { @@ -86,7 +91,7 @@ export default { class=" btn btn-grouper btn-primary px-4 border-0" type="button" @click="performAction()" - :disabled="activeBtn"> + :disabled="isBtnDisabled"> {{ btnTxt }} diff --git a/webroot/js/members.js b/webroot/js/members.js index c031bd1..7c900ac 100644 --- a/webroot/js/members.js +++ b/webroot/js/members.js @@ -163,7 +163,7 @@ export default {
- +
diff --git a/webroot/js/page/UserManager.js b/webroot/js/page/UserManager.js index cbc874d..0677a2c 100644 --- a/webroot/js/page/UserManager.js +++ b/webroot/js/page/UserManager.js @@ -46,7 +46,7 @@ export default { } }, template: /*html*/` -