diff --git a/src/framework/theme/components/select/select.component.ts b/src/framework/theme/components/select/select.component.ts index fa4753e7b0..a2c6b8d3a9 100644 --- a/src/framework/theme/components/select/select.component.ts +++ b/src/framework/theme/components/select/select.component.ts @@ -31,7 +31,7 @@ import { import { NgClass } from '@angular/common'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { merge, Subject, BehaviorSubject, from } from 'rxjs'; -import { startWith, switchMap, takeUntil, filter, map, finalize } from 'rxjs/operators'; +import { startWith, switchMap, takeUntil, filter, map, finalize, take } from 'rxjs/operators'; import { NbStatusService } from '../../services/status.service'; import { @@ -914,7 +914,11 @@ export class NbSelectComponent show() { if (this.isHidden) { this.attachToOverlay(); - this.setActiveOption(); + + this.positionStrategy.positionChange.pipe(take(1), takeUntil(this.destroy$)).subscribe(() => { + this.setActiveOption(); + }); + this.cd.markForCheck(); } }