Fixed chore/battery camera barcode scanning blur event handling (fixes #1585)

This commit is contained in:
Bernd Bestel 2021-08-17 17:48:45 +02:00
parent 8e552f1146
commit 7f70f0ec07
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 29 additions and 2 deletions

View File

@ -6,4 +6,5 @@
- Fixed that the "Stock by-barcode" API routes also accepted chore or battery grocycodes (thanks @lowlee)
- Fixed that it was not possible to select a chore/battery on the corresponding tracking pages by mouse/touch
- Fixed that grouping by columns in tables may caused duplicate groups
- Fixed that grocycode camera barcode scanning didn't recognize the scanned code for chore/battery tracking
- Optimized the meal plan page to be properly printable (thanks @MrKrisKrisu)

View File

@ -105,7 +105,20 @@ $(document).on("Grocy.BarcodeScanned", function(e, barcode, target)
return;
}
$('#battery_id_text_input').val(barcode).trigger('change');
// Don't know why the blur event does not fire immediately ... this works...
$("#battery_id_text_input").focusout();
$("#battery_id_text_input").focus();
$("#battery_id_text_input").blur();
$("#battery_id_text_input").val(barcode);
setTimeout(function()
{
$("#battery_id_text_input").focusout();
$("#battery_id_text_input").focus();
$("#battery_id_text_input").blur();
Grocy.Components.DateTimePicker.GetInputElement().focus();
}, 200);
});
function UndoChargeCycle(chargeCycleId)

View File

@ -121,7 +121,20 @@ $(document).on("Grocy.BarcodeScanned", function(e, barcode, target)
return;
}
$('#chore_id_text_input').val(barcode).trigger('change');
// Don't know why the blur event does not fire immediately ... this works...
$("#chore_id_text_input").focusout();
$("#chore_id_text_input").focus();
$("#chore_id_text_input").blur();
$("#chore_id_text_input").val(barcode);
setTimeout(function()
{
$("#chore_id_text_input").focusout();
$("#chore_id_text_input").focus();
$("#chore_id_text_input").blur();
Grocy.Components.DateTimePicker.GetInputElement().focus();
}, 200);
});
Grocy.Components.DateTimePicker.GetInputElement().on('keypress', function(e)