Et2Select: Remove any doubled values when setting value

This commit is contained in:
nathan 2023-02-13 14:00:16 -07:00
parent fe7897b563
commit d02a40ee82

View File

@ -441,7 +441,8 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
} }
if(Array.isArray(val)) if(Array.isArray(val))
{ {
val = val.map(v => typeof v === 'number' ? v.toString() : v || ''); // Make sure value has no duplicates, and values are strings
val = [...new Set(val.map(v => typeof v === 'number' ? v.toString() : v || ''))];
} }
this.value = val || ''; this.value = val || '';
} }