Make sure options are clean before trying to merge them. Fixers broken historylog.

Also filter out duplicate options.
This commit is contained in:
nathan 2022-07-19 14:20:39 -06:00
parent 2bcebeed42
commit 3b147eaa49

View File

@ -116,8 +116,9 @@ export function find_select_options(widget, attr_options?, options : SelectOptio
} }
if(attr_options && Object.keys(attr_options).length > 0 && content_options) if(attr_options && Object.keys(attr_options).length > 0 && content_options)
{ {
//content_options = jQuery.extend(true, {}, attr_options, content_options); // Clean, merge and filter out duplicates
content_options = [...attr_options, ...content_options]; content_options = [...new Map([...cleanSelectOptions(options), ...cleanSelectOptions(content_options || [])].map(item =>
[item.value, item])).values()];
} }
} }