From 06253ed8f2d97583ae7324356e8d0fd35e89d924 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:36:22 -0800 Subject: [PATCH] titleInput may be undefined if in a different tab --- .../app/components/document-detail/document-detail.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 861079037..f03270547 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -232,7 +232,7 @@ export class DocumentDetailComponent implements OnInit, OnDestroy, DirtyComponen .subscribe(({updateResult, nextDocId, closeResult}) => { if (closeResult) { this.router.navigate(['documents', nextDocId]) - this.titleInput.focus() + this.titleInput?.focus() } }, error => { this.networkActive = false