@klippa/ngx-enhancy-forms 14.10.3 → 14.10.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.
@@ -173,7 +173,7 @@ class FormComponent {
173
173
  this.formGroup.patchValue(valueBeforeInject);
174
174
  }
175
175
  injectInto.setControl(injectAt, this.formGroup);
176
- this.onInjected.emit();
176
+ this.onInjected.emit(valueBeforeInject);
177
177
  }
178
178
  else if (injectInto instanceof UntypedFormGroup) {
179
179
  if (typeof injectAt !== 'string') {
@@ -187,7 +187,7 @@ class FormComponent {
187
187
  this.formGroup.patchValue(valueBeforeInject);
188
188
  }
189
189
  injectInto.setControl(injectAt, this.formGroup);
190
- this.onInjected.emit();
190
+ this.onInjected.emit(valueBeforeInject);
191
191
  }
192
192
  }
193
193
  }
@@ -943,7 +943,9 @@ class SelectComponent extends ValueAccessorBase {
943
943
  this.lastItemIndexReached = -1;
944
944
  this.setWidthBasedOnOptionsWidths();
945
945
  }
946
- this.dropdownPositionToUse = this.dropdownPosition;
946
+ if (this.dropdownPosition === 'top' || this.dropdownPosition === 'bottom' || this.dropdownPosition === 'auto') {
947
+ this.dropdownPositionToUse = this.dropdownPosition;
948
+ }
947
949
  }
948
950
  getDefaultTranslation(key) {
949
951
  switch (key) {
@@ -998,7 +1000,8 @@ class SelectComponent extends ValueAccessorBase {
998
1000
  const spaceInParent = limitingParentContainer.clientWidth;
999
1001
  const spaceLeftOfElRef = this.elRef?.nativeElement.getBoundingClientRect().left - limitingParentContainer.getBoundingClientRect().left;
1000
1002
  const spaceRightOfElRef = spaceInParent - spaceLeftOfElRef;
1001
- if (spaceRightOfElRef < dropdownPanel?.clientWidth) {
1003
+ const spaceNeeded = dropdownPanel?.clientWidth ?? 0;
1004
+ if (this.dropdownPosition === 'right' || spaceRightOfElRef < spaceNeeded) {
1002
1005
  dropdownPanel.style.right = `0px`;
1003
1006
  }
1004
1007
  }