Fix additional options to a static list were not properly added if they were in correct format with value & label

This commit is contained in:
nathan 2022-11-21 09:14:27 -07:00
parent a823563281
commit 1d540aa74c

View File

@ -173,10 +173,13 @@ export function find_select_options(widget, attr_options?, options : SelectOptio
}
if(!added)
{
options.splice(parseInt(i), 0, typeof value == "object" ? value : {
value: value,
label: <string><unknown>content_options[i]
});
let insert = typeof content_options[i] == "object" && content_options[i].value === value && content_options[i].label ?
content_options[i] :
{
value: value,
label: <string><unknown>content_options[i]
};
options.splice(parseInt(i), 0, insert);
}
}
content_options = options;