diff --git a/package.json b/package.json index 6709c2ae..dbb1cd39 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "grocy", "private": true, "dependencies": { - "@danielfarrell/bootstrap-combobox": "https://github.com/pallidus-fintech/bootstrap-combobox.git#enhance/boostrap_4", + "@danielfarrell/bootstrap-combobox": "https://github.com/berrnd/bootstrap-combobox.git#master", "@fortawesome/fontawesome-free": "^5.1.0", "TagManager": "https://github.com/max-favilli/tagmanager.git#3.0.2", "bootbox": "https://github.com/makeusabrew/bootbox.git#v5.x", diff --git a/public/viewjs/batterytracking.js b/public/viewjs/batterytracking.js index 1b73144b..1d7c3a8a 100644 --- a/public/viewjs/batterytracking.js +++ b/public/viewjs/batterytracking.js @@ -49,7 +49,8 @@ $('#battery_id').on('change', function(e) }); $('.combobox').combobox({ - appendId: '_text_input' + appendId: '_text_input', + bsVersion: '4' }); $('#battery_id').val(''); diff --git a/public/viewjs/choretracking.js b/public/viewjs/choretracking.js index ddd3bddb..f3226c1f 100644 --- a/public/viewjs/choretracking.js +++ b/public/viewjs/choretracking.js @@ -48,7 +48,8 @@ $('#chore_id').on('change', function(e) }); $('.combobox').combobox({ - appendId: '_text_input' + appendId: '_text_input', + bsVersion: '4' }); $('#chore_id_text_input').focus(); diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index f71e9c2d..9a8eb16c 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -45,7 +45,8 @@ Grocy.Components.ProductPicker.HideCustomError = function() $('.product-combobox').combobox({ appendId: '_text_input', - bsVersion: '4' + bsVersion: '4', + clearIfNoMatch: false }); var prefillProduct = GetUriParam('createdproduct'); @@ -81,7 +82,7 @@ if (addBarcode !== undefined) $('#barcode-lookup-disabled-hint').removeClass('d-none'); } -$('#product_id').on('change', function(e) +$('#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(); @@ -106,14 +107,20 @@ $('#product_id').on('change', function(e) bootbox.dialog({ message: L('"#1" could not be resolved to a product, how do you want to proceed?', input), title: L('Create or assign product'), - onEscape: function() { }, + onEscape: function() + { + Grocy.Components.ProductPicker.SetValue(''); + }, size: 'large', backdrop: true, buttons: { cancel: { label: L('Cancel'), className: 'btn-default responsive-button', - callback: function() { } + callback: function() + { + Grocy.Components.ProductPicker.SetValue(''); + } }, addnewproduct: { label: 'P ' + L('Add as new product'), diff --git a/yarn.lock b/yarn.lock index c1a8a90a..5fb5c550 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,15 +2,15 @@ # yarn lockfile v1 -"@danielfarrell/bootstrap-combobox@https://github.com/pallidus-fintech/bootstrap-combobox.git#enhance/boostrap_4": +"@danielfarrell/bootstrap-combobox@https://github.com/berrnd/bootstrap-combobox.git#master": version "1.1.8" - resolved "https://github.com/pallidus-fintech/bootstrap-combobox.git#0bd1da781b99d390f1c75315b6025e7d8658b263" + resolved "https://github.com/berrnd/bootstrap-combobox.git#d5a43b011d4d2c86537df26e15d2caa51be6a15f" "@fortawesome/fontawesome-free@^5.1.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.3.1.tgz#5466b8f31c1f493a96754c1426c25796d0633dd9" -"TagManager@https://github.com/max-favilli/tagmanager.git#3.0.2": +"TagManager@https://github.com/max-favilli/tagmanager.git#3.0.2", "tagmanager@https://github.com/max-favilli/tagmanager.git#3.0.2": version "3.0.1" resolved "https://github.com/max-favilli/tagmanager.git#df9eb9935c8585a392dfc00602f890caf233fa94" dependencies: