From 7cdb333714656b095bd1c832c66b9a27dc845b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 29 Jul 2021 19:33:00 +0300 Subject: [PATCH] Document item create new item support enter key. --- .../assets/js/components/AkauntingItemButton.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/components/AkauntingItemButton.vue b/resources/assets/js/components/AkauntingItemButton.vue index 574a1544b..23df15eaf 100644 --- a/resources/assets/js/components/AkauntingItemButton.vue +++ b/resources/assets/js/components/AkauntingItemButton.vue @@ -26,7 +26,7 @@ :ref="'input-item-field-' + _uid" v-model="search" @input="onInput" - @keyup.enter="onInput" + @keydown.enter="onItemCreate" /> @@ -273,13 +273,14 @@ export default { if (!this.search) { return; } + //condition that checks if input is below the given character limit if (this.search.length < this.searchCharLimit) { - this.setItemList(this.items); //once the user deletes the search input, we show the overall item list - this.sortItems(); // we order it as wanted - this.$emit('input', this.search); // keep the input binded to v-model + this.setItemList(this.items); //once the user deletes the search input, we show the overall item list + this.sortItems(); // we order it as wanted + this.$emit('input', this.search); // keep the input binded to v-model - return; + return; } window.axios.get(url + '/common/items?search="' + this.search + '" limit:10')