From 2b0f5d8d84ddb63c14ef287cae12046a4b161719 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 27 Sep 2019 17:27:45 +0200 Subject: [PATCH] Only do a product by barcode lookup if there is actually any input --- public/viewjs/components/productpicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index 6d804bfb..47280857 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -136,7 +136,7 @@ $('#product_id_text_input').on('blur', function(e) var input = $('#product_id_text_input').val().toString(); var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + input + ",\"]").first(); - if (GetUriParam('addbarcodetoselection') === undefined && possibleOptionElement.length > 0) + if (GetUriParam('addbarcodetoselection') === undefined && input.length > 0 && possibleOptionElement.length > 0) { $('#product_id').val(possibleOptionElement.val()); $('#product_id').data('combobox').refresh();