mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
Fix option merge unique filter left out some options
This commit is contained in:
parent
f79c57f048
commit
5ee60c0af1
@ -46,18 +46,10 @@ export const Et2StaticSelectMixin = <T extends Constructor<Et2WidgetWithSelect>>
|
||||
// @ts-ignore
|
||||
const options = super.select_options || [];
|
||||
// make sure result is unique
|
||||
if (options.length && this.static_options.length)
|
||||
{
|
||||
const union = [].concat(options);
|
||||
this.static_options.forEach(option => {
|
||||
if (!union.filter(opt => opt.value == option.value).length)
|
||||
{
|
||||
union.concat(option);
|
||||
}
|
||||
});
|
||||
return union;
|
||||
}
|
||||
return [...options, ...(this.static_options || [])];
|
||||
|
||||
return [...new Map([...options, ...(this.static_options || [])].map(item =>
|
||||
[item.value, item])).values()];
|
||||
|
||||
}
|
||||
|
||||
set select_options(new_options)
|
||||
|
Loading…
Reference in New Issue
Block a user