@vgip/meta-ui 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2952,7 +2952,13 @@ class FieldSelect extends FieldAbstract {
2952
2952
  set: (value) => {
2953
2953
  if (this.multiple) {
2954
2954
  if (value && value instanceof Array === false) {
2955
- value = [value];
2955
+ for (const o of this.options) {
2956
+ if ((value.id || value) === (o.id || o.value || o.name || 0)) {
2957
+ this.model = [o];
2958
+ this.value = [this.modelToValue(o, this.meta.valueType)];
2959
+ break;
2960
+ }
2961
+ }
2956
2962
  }
2957
2963
  if (!value || value.length) {
2958
2964
  const values = (value instanceof Array) ? value : (value || '').split(';'); // should not handle incorrect values
@@ -2963,7 +2969,7 @@ class FieldSelect extends FieldAbstract {
2963
2969
  for (const o of this.options) {
2964
2970
  if ((v.id || v) === (o.id || o.value || o.name || 0)) {
2965
2971
  this.model.push(o);
2966
- this.value.push(v);
2972
+ this.value.push(this.modelToValue(o, this.meta.valueType));
2967
2973
  break;
2968
2974
  }
2969
2975
  }