You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2020/07/02 10:07:40 UTC

[myfaces-tobago] branch master updated: avoid JS browser-warning

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 074b764  avoid JS browser-warning
074b764 is described below

commit 074b764ba519d7120264f584af2aa9d312d2c3b5
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Jul 2 12:07:28 2020 +0200

    avoid JS browser-warning
---
 .../tobago-theme-standard/src/main/npm/ts/tobago-focus.ts         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-focus.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-focus.ts
index beab956..e54fd9c 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-focus.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-focus.ts
@@ -98,8 +98,12 @@ export class Focus extends HTMLElement {
 
   private get lastFocusedElement(): HTMLElement {
     const lastFocusId: string = this.hiddenInput.value;
-    const root = this.getRootNode() as ShadowRoot | Document;
-    return root.getElementById(lastFocusId);
+    if (lastFocusId) {
+      const root = this.getRootNode() as ShadowRoot | Document;
+      return root.getElementById(lastFocusId);
+    } else {
+      return null;
+    }
   }
 
   private get hiddenInput(): HTMLInputElement {