Skip to content

Commit

Permalink
Fix the overlay width at opening
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefling committed Dec 11, 2024
1 parent adc23d2 commit 513a75c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions projects/ng-select2-component/src/lib/select2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,15 @@ export class Select2 implements ControlValueAccessor, OnInit, DoCheck, AfterView
if (this._triggerRect) {
if (this.overlayWidth !== this._triggerRect.width) {
this.overlayWidth = this._triggerRect.width;
this._changeDetectorRef.detectChanges();
}
if (
this._dropdownRect &&
this._dropdownRect.height > 0 &&
this.overlayHeight !== this._dropdownRect.height
) {
this.overlayHeight = this.listPosition() === 'auto' ? this._dropdownRect.height : 0;
this._changeDetectorRef.detectChanges();
}
}
}
Expand Down

0 comments on commit 513a75c

Please sign in to comment.