From 7c7c5db28c5c308c399136069ca185f60b47577f Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 9 Jun 2019 09:21:56 +0200 Subject: [PATCH] Fixed that a entered barcode on the product edit page was only saved when "adding" it to the barcodes list by pressing TAB (closes #269) --- changelog/49_2.4.2_xxxx-xx-xx.md | 1 + public/viewjs/productform.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/changelog/49_2.4.2_xxxx-xx-xx.md b/changelog/49_2.4.2_xxxx-xx-xx.md index eaddeea7..acfc1274 100644 --- a/changelog/49_2.4.2_xxxx-xx-xx.md +++ b/changelog/49_2.4.2_xxxx-xx-xx.md @@ -5,5 +5,6 @@ - Fixed that login did not work when "Stay logged in permanently" was set on grocy runs on a 32-bit system (thanks @matejdro) - Fixed page reloads when "Auto reload on external changes" is enabled and there is unsaved form data (the detection did not work on forms in modal dialogs, e. g. when adding a entry to the meal plan) - Fixed (again) that the product picker did not work properly when the product name contains single quotes +- Fixed that a entered barcode on the product edit page was only saved when "adding" it to the barcodes list by pressing `TAB` (is now automatically added to the list also when just leaving the field) - Improved that errors/messages from the API are shown properly when undoing a stock booking is not possible (stock journal page) - Improved night mode CSS (done by @BlizzWave, thanks!) diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index b2cd6d63..2c0e3785 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -149,6 +149,11 @@ if (prefillBarcode !== undefined) $('#name').focus(); } +$("#barcode-taginput").on("blur", function(e) +{ + $("#barcode-taginput").tagsManager("pushTag", $("#barcode-taginput").val()); +}); + $('.input-group-qu').on('change', function(e) { var quIdPurchase = $("#qu_id_purchase").val();