Skip to content

Commit

Permalink
fix(FEC-13295) Download plugin - Accessibility - Need to change the d…
Browse files Browse the repository at this point in the history
…ownload button lable in the download overlay (#18)

screen reader reads the file name in the download button,
change it to “Click to download the video”

solves FEC-13295
  • Loading branch information
Tzipi-kaltura authored Aug 23, 2023
1 parent 3eb00d9 commit f545f6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/download-overlay/download-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface DownloadOverlayProps {
downloadStartedLabel?: string;
downloadFailedLabel?: string;
closeLabel?: string;
downloadButtonLabel?: string;
setFocus: () => void;
}

Expand Down Expand Up @@ -61,7 +62,8 @@ const DownloadOverlay = withText({
downloadsLabel: 'download.downloads',
downloadStartedLabel: 'download.download_has_started',
downloadFailedLabel: 'download.download_has_failed',
closeLabel: 'overlay.close'
closeLabel: 'overlay.close',
downloadButtonLabel: 'download.download_button_label'
})(
connect(mapStateToProps)(
withEventManager(
Expand All @@ -74,6 +76,7 @@ const DownloadOverlay = withText({
downloadStartedLabel,
downloadFailedLabel,
closeLabel,
downloadButtonLabel,
setFocus
}: DownloadOverlayProps) => {
const [isVisible, setIsVisible] = useState(false);
Expand Down Expand Up @@ -125,6 +128,7 @@ const DownloadOverlay = withText({
data-testid="download-overlay-download-button"
className={`${styles.fileInfo} ${sizeClass}`}
tabIndex={0}
aria-label={downloadButtonLabel}
ref={downloadRef}
onBlur={() => {
if (isVisible) {
Expand Down
3 changes: 2 additions & 1 deletion translations/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"downloads": "Downloads",
"download_has_started": "Download has started",
"download_has_failed": "Download has failed",
"attachments": "Attachments"
"attachments": "Attachments",
"download_button_label": "Click to download the video"
}
}
}

0 comments on commit f545f6f

Please sign in to comment.