@klippa/ngx-enhancy-forms 14.1.2 → 14.1.3
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.
- package/esm2020/lib/elements/select/select.component.mjs +19 -7
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +18 -6
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +18 -6
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -836,12 +836,24 @@ class SelectComponent extends ValueAccessorBase {
|
|
|
836
836
|
}
|
|
837
837
|
setWidthBasedOnOptionsWidths() {
|
|
838
838
|
if (this.truncateOptions === false) {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
dropdownPanel
|
|
844
|
-
|
|
839
|
+
setTimeout(() => {
|
|
840
|
+
const widths = Array.from(this.elRef.nativeElement.querySelectorAll('.ng-option div')).map((e) => e.scrollWidth);
|
|
841
|
+
const maxWidth = Math.max(...widths);
|
|
842
|
+
const dropdownPanel = this.elRef.nativeElement.querySelector('ng-dropdown-panel');
|
|
843
|
+
if (dropdownPanel) {
|
|
844
|
+
dropdownPanel.style.width = `${maxWidth + 40}px`;
|
|
845
|
+
}
|
|
846
|
+
let current = this.elRef.nativeElement;
|
|
847
|
+
while (current.parentElement && !this.isLimitingContainer(current)) {
|
|
848
|
+
current = current.parentElement;
|
|
849
|
+
}
|
|
850
|
+
if (dropdownPanel) {
|
|
851
|
+
const overflow = dropdownPanel.getBoundingClientRect().left + maxWidth + 40 - current.clientWidth;
|
|
852
|
+
if (overflow > 0) {
|
|
853
|
+
dropdownPanel.style.left = `-${overflow}px`;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
});
|
|
845
857
|
}
|
|
846
858
|
}
|
|
847
859
|
determineDropdownPosition() {
|