@3kles/kles-material-dynamicforms 14.9.3 → 14.9.5

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.
@@ -2179,7 +2179,7 @@ class KlesFormGroup extends KlesFormControl {
2179
2179
  const subGroup = new UntypedFormGroup({});
2180
2180
  if (this.field.collections && Array.isArray(this.field.collections)) {
2181
2181
  this.field.collections.forEach(subfield => {
2182
- const control = new KlesFormControl(subfield).create();
2182
+ const control = new KlesFormControl({ ...subfield, value: subfield.value || this.field.value?.[subfield.name] }).create();
2183
2183
  subGroup.addControl(subfield.name, control);
2184
2184
  });
2185
2185
  }
@@ -3145,9 +3145,12 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
3145
3145
  openChangeEvent() {
3146
3146
  this.openChange$
3147
3147
  .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
3148
- return this.onOpenChange(isOpen);
3148
+ return this.onOpenChange(isOpen).pipe(map((options) => ({ options, isOpen })));
3149
3149
  }))
3150
- .subscribe((options) => {
3150
+ .subscribe(({ options, isOpen }) => {
3151
+ if (!isOpen) {
3152
+ this.searchControl.reset(null, { emitEvent: false });
3153
+ }
3151
3154
  this.optionsFiltered$.next(options);
3152
3155
  this.isLoading = false;
3153
3156
  this.ref.markForCheck();