Skip to content

Commit

Permalink
fix(ui): Avoid submitting form if player is inside form (#4866)
Browse files Browse the repository at this point in the history
`button` element by default has `type` set to `submit` which can
interfere with forms.

Fixes #4861
  • Loading branch information
WINOFFRG authored Jan 3, 2023
1 parent 5681efe commit da21850
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/util/dom_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit da21850

Please sign in to comment.