From 0befef014af75df1f5d9f14fefabb27354e976d5 Mon Sep 17 00:00:00 2001 From: winoffrg Date: Tue, 3 Jan 2023 13:33:20 +0530 Subject: [PATCH 1/3] fix(ui): adding button type on button element --- lib/util/dom_utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/util/dom_utils.js b/lib/util/dom_utils.js index 1018a5f902..ce127569b7 100644 --- a/lib/util/dom_utils.js +++ b/lib/util/dom_utils.js @@ -36,7 +36,9 @@ shaka.util.Dom = class { * @return {!HTMLButtonElement} */ static createButton() { - return /** @type {!HTMLButtonElement} */(document.createElement('button')); + const button = document.createElement('button'); + button.setAttribute('type', 'button'); + return /** @type {!HTMLButtonElement} */(button); } @@ -89,4 +91,3 @@ shaka.util.Dom = class { } } }; - From a4f70c491e1f5ca2a0c0d28cba9371fa81eaa403 Mon Sep 17 00:00:00 2001 From: winoffrg Date: Tue, 3 Jan 2023 14:10:54 +0530 Subject: [PATCH 2/3] Revert "fix(ui): adding button type on button element" This reverts commit 0befef014af75df1f5d9f14fefabb27354e976d5. --- lib/util/dom_utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/util/dom_utils.js b/lib/util/dom_utils.js index ce127569b7..1018a5f902 100644 --- a/lib/util/dom_utils.js +++ b/lib/util/dom_utils.js @@ -36,9 +36,7 @@ shaka.util.Dom = class { * @return {!HTMLButtonElement} */ static createButton() { - const button = document.createElement('button'); - button.setAttribute('type', 'button'); - return /** @type {!HTMLButtonElement} */(button); + return /** @type {!HTMLButtonElement} */(document.createElement('button')); } @@ -91,3 +89,4 @@ shaka.util.Dom = class { } } }; + From 162633c665f1088abe5f7120e732b4ee0d135386 Mon Sep 17 00:00:00 2001 From: winoffrg Date: Tue, 3 Jan 2023 14:18:53 +0530 Subject: [PATCH 3/3] revert linter error --- lib/util/dom_utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util/dom_utils.js b/lib/util/dom_utils.js index 1018a5f902..593e1d0c97 100644 --- a/lib/util/dom_utils.js +++ b/lib/util/dom_utils.js @@ -36,7 +36,9 @@ shaka.util.Dom = class { * @return {!HTMLButtonElement} */ static createButton() { - return /** @type {!HTMLButtonElement} */(document.createElement('button')); + const button = document.createElement('button'); + button.setAttribute('type', 'button'); + return /** @type {!HTMLButtonElement} */ (button); }