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
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 6 additions and 2 deletions

View File

@ -46,7 +46,7 @@
### Userfields
- xxx
- Fixed that when having a userfield of type "Select list (multiple items can be selected)" and selecting no item, editing of the corresponding form was broken
### General

View File

@ -142,8 +142,12 @@ Grocy.Components.UserfieldsForm.Load = function()
input.prop("checked", true);
}
else if (input.hasAttr("multiple"))
{
if (value)
{
input.val(value.split(","));
}
$(".selectpicker").selectpicker("render");
}
else if (input.attr('type') == "file")