From 2f7cb82ca040e3bff433a11b2a2a4e28d802d7d0 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Sat, 26 Aug 2017 09:58:15 +0530 Subject: [PATCH] [Fix] POS Scanner Search item based on key press instead of 1sec wait Fast Scanning needs this to avoid 1sec delay --- erpnext/accounts/page/pos/pos.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index d69a306670..ee4644a51e 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -426,11 +426,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ }); this.serach_item.make_input(); - this.serach_item.$input.on("keyup", function () { - setTimeout(function () { + this.serach_item.$input.on("keypress", function (event) { + if((me.serach_item.$input.val() != "") && (event.which == 13)){ me.items = me.get_items(); me.make_item_list(); - }, 1000); + } }); this.search_item_group = this.wrapper.find('.search-item-group');