More initial form field focus optimizations

This commit is contained in:
Bernd Bestel
2025-01-12 17:57:50 +01:00
parent 7d6b76effb
commit 632162c1be
24 changed files with 111 additions and 29 deletions

View File

@@ -489,7 +489,10 @@ if (Grocy.Components.ProductPicker)
{
if (Grocy.Components.ProductPicker.InAnyFlow() === false && GetUriParam("embedded") === undefined)
{
Grocy.Components.ProductPicker.GetInputElement().focus();
setTimeout(function()
{
Grocy.Components.ProductPicker.GetInputElement().focus();
}, 500);
}
else
{
@@ -497,7 +500,10 @@ if (Grocy.Components.ProductPicker)
if (Grocy.Components.ProductPicker.InProductModifyWorkflow())
{
Grocy.Components.ProductPicker.GetInputElement().focus();
setTimeout(function()
{
Grocy.Components.ProductPicker.GetInputElement().focus();
}, 500);
}
}
}
@@ -506,7 +512,10 @@ $('#display_amount').on('focus', function(e)
{
if (Grocy.Components.ProductPicker.GetValue().length === 0)
{
Grocy.Components.ProductPicker.GetInputElement().focus();
setTimeout(function()
{
Grocy.Components.ProductPicker.GetInputElement().focus();
}, 500);
}
else
{