Properly handle empty select-multiple userfield (fixes #2339)

This commit is contained in:
Bernd Bestel
2023-09-15 13:43:58 +02:00
parent c8891236e6
commit 1e60f940e4
2 changed files with 6 additions and 2 deletions

View File

@@ -143,7 +143,11 @@ Grocy.Components.UserfieldsForm.Load = function()
}
else if (input.hasAttr("multiple"))
{
input.val(value.split(","));
if (value)
{
input.val(value.split(","));
}
$(".selectpicker").selectpicker("render");
}
else if (input.attr('type') == "file")