diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index 1b2db73d..c8dce9e1 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -40,6 +40,7 @@ - The decimal places for all amount and price inputs can now be configured (stock settings / top right corner settings menu, both default to `4`) - When clicking the product name on the shopping list, the product card will now be displayed (like on the stock overview page) (thanks @kriddles) - On the product card there is now also a button to jump directly to the stock entries of the corresponding product (thanks @kriddles) +- The product picker workflows can now also be started by `ENTER` (instead of only `TAB`) - Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB` - Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu) - Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles) diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index 16d4bd5f..cfb32e1b 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -257,3 +257,17 @@ $(document).on("shown.bs.modal", function(e) $(".modal-footer").addClass("d-block").addClass("d-sm-flex"); $(".modal-footer").find("button").addClass("mt-2").addClass("mt-sm-0"); }) + +// Make that ENTER behaves the same like TAB (trigger blur to start workflows, but only when the dropdown is not opened) +$('#product_id_text_input').keydown(function(event) +{ + if (event.keyCode === 13) // Enter + { + if (Grocy.Components.ProductPicker.GetPicker().hasClass("combobox-menu-visible")) + { + return; + } + + $("#product_id_text_input").trigger("blur"); + } +});