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 (NG-ZORRO#3203)

close NG-ZORRO#3200
  • Loading branch information
hsuanxyz authored and Ricbet committed Apr 9, 2020
1 parent e7bd682 commit 8555e1a
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 8555e1a

Please sign in to comment.