Skip to content

Commit

Permalink
add type="button" to all button tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lhz516 committed Apr 14, 2020
1 parent f704fd5 commit 8e17d45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-h5-audio-player",
"version": "3.0.4",
"version": "3.0.5",
"description": "A customizable React audio player. Written in TypeScript. Mobile compatible. Keyboard friendly",
"main": "./lib/index.js",
"module": "./es/index.js",
Expand Down
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label="Previous"
className="rhap_button-clear rhap_main-controls-button rhap_skip-button"
type="button"
onClick={onClickPrevious}
>
{customIcons.previous ? customIcons.previous : <Icon icon={skipPrevious} />}
Expand All @@ -353,6 +354,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label="Rewind"
className="rhap_button-clear rhap_main-controls-button rhap_rewind-button"
type="button"
onClick={this.handleClickRewind}
>
{customIcons.rewind ? customIcons.rewind : <Icon icon={rewind} />}
Expand All @@ -361,6 +363,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label={isPlaying ? 'Pause' : 'Play'}
className="rhap_button-clear rhap_main-controls-button rhap_play-pause-button"
type="button"
onClick={this.togglePlay}
>
{actionIcon}
Expand All @@ -369,6 +372,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label="Forward"
className="rhap_button-clear rhap_main-controls-button rhap_forward-button"
type="button"
onClick={this.handleClickForward}
>
{customIcons.forward ? customIcons.forward : <Icon icon={fastForward} />}
Expand All @@ -378,6 +382,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label="Skip"
className="rhap_button-clear rhap_main-controls-button rhap_skip-button"
type="button"
onClick={onClickNext}
>
{customIcons.next ? customIcons.next : <Icon icon={skipNext} />}
Expand Down Expand Up @@ -406,6 +411,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
key={key}
aria-label={loop ? 'Enable Loop' : 'Disable Loop'}
className="rhap_button-clear rhap_repeat-button"
type="button"
onClick={this.handleClickLoopButton}
>
{loopIcon}
Expand All @@ -426,6 +432,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
<button
aria-label={volume ? 'Mute' : 'Unmute'}
onClick={this.handleClickVolumeButton}
type="button"
className="rhap_button-clear rhap_volume-button"
>
{volumeIcon}
Expand Down

0 comments on commit 8e17d45

Please sign in to comment.