Skip to content

Commit

Permalink
fix(TextTrackSetting): Do not use default button type. (#5512)
Browse files Browse the repository at this point in the history
The default button type is "submit" which triggers a form submit. Thus
if videojs is embedded in a form element the button triggers a form
submit.

This is the same problem with same solution as discussed in #2470
  • Loading branch information
syranez authored and gkatsev committed Oct 22, 2018
1 parent 46e3ef0 commit dfcfa45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/tracks/text-track-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ class TextTrackSettings extends ModalDialog {
return createEl('div', {
className: 'vjs-track-settings-controls',
innerHTML: [
`<button class="vjs-default-button" title="${defaultsDescription}">`,
`<button type="button" class="vjs-default-button" title="${defaultsDescription}">`,
this.localize('Reset'),
`<span class="vjs-control-text"> ${defaultsDescription}</span>`,
'</button>',
`<button class="vjs-done-button">${this.localize('Done')}</button>`
`<button type="button" class="vjs-done-button">${this.localize('Done')}</button>`
].join('')
});
}
Expand Down

0 comments on commit dfcfa45

Please sign in to comment.