Skip to content

Commit

Permalink
fix(module:drawer): create focus trap error when nzVisible default …
Browse files Browse the repository at this point in the history
…value is true (#3203)

close #3200
  • Loading branch information
hsuanxyz committed Apr 15, 2019
1 parent a77f6c9 commit 327ceca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/drawer/nz-drawer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ export class NzDrawerComponent<T = any, R = any, D = any> extends NzDrawerRef<R>
}

private trapFocus(): void {
if (!this.focusTrap) {
if (!this.focusTrap && this.overlayRef && this.overlayRef.overlayElement) {
this.focusTrap = this.focusTrapFactory.create(this.overlayRef!.overlayElement);
this.focusTrap.focusInitialElement();
}
this.focusTrap.focusInitialElement();
}

private restoreFocus(): void {
Expand Down

0 comments on commit 327ceca

Please sign in to comment.