Skip to content

Commit

Permalink
Merge pull request #295 from Financial-Times/x-audio-accessibility
Browse files Browse the repository at this point in the history
Add aria-labels to buttons
  • Loading branch information
debugwand authored May 14, 2019
2 parents c20b298 + 587441d commit 1e4d9ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion __tests__/__snapshots__/snapshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`@financial-times/x-audio renders a default App player x-audio 1`] = `
className="styles_audio-player__2nupy styles_audio-player--minimised__ONFa_"
>
<button
aria-label="Close this player."
className="styles_audio-player__close__2lUat"
onClick={[Function]}
/>
Expand All @@ -24,9 +25,9 @@ exports[`@financial-times/x-audio renders a default App player x-audio 1`] = `
10 mins remaining
</div>
<button
aria-label="play"
className="styles_audio-player__play-pause__3HvnM styles_audio-player__play-pause--play__3TyLp"
onClick={[Function]}
title="play"
/>
</div>
`;
Expand Down
4 changes: 2 additions & 2 deletions components/x-audio/src/components/Buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PlayPause = ({
}) => (
<button
className={classNameMap('audio-player__play-pause', `audio-player__play-pause--${playing ? 'pause' : 'play'}`)}
title={playing ? 'pause' : 'play'}
aria-label={playing ? 'pause' : 'play'}
onClick={playing ? () => onPauseClick() : () => onPlayClick()}/>
)

Expand All @@ -22,7 +22,7 @@ PlayPause.propTypes = {
export const Close = ({
onClick
}) => (
<button className={classNameMap('audio-player__close')} onClick={() => onClick()}/>
<button aria-label='Close this player.' className={classNameMap('audio-player__close')} onClick={() => onClick()}/>
)

Close.propTypes = {
Expand Down

0 comments on commit 1e4d9ae

Please sign in to comment.