Skip to content

Commit

Permalink
fix: add aria label for removing attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
gosiexon-zen committed Nov 14, 2024
1 parent a9a12f0 commit 7f80ffc
Show file tree
Hide file tree
Showing 7 changed files with 40,278 additions and 71 deletions.
32 changes: 31 additions & 1 deletion assets/flash-notifications-bundle.js

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

1,488 changes: 1,446 additions & 42 deletions assets/new-request-form-bundle.js

Large diffs are not rendered by default.

3,482 changes: 3,481 additions & 1 deletion assets/new-request-form-translations-bundle.js

Large diffs are not rendered by default.

35,293 changes: 35,269 additions & 24 deletions assets/shared-bundle.js

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion assets/wysiwyg-bundle.js

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions src/modules/new-request-form/fields/attachments/FileListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Anchor } from "@zendeskgarden/react-buttons";
import { File, FileList } from "@zendeskgarden/react-forms";
import { Progress } from "@zendeskgarden/react-loaders";
import { Tooltip } from "@zendeskgarden/react-tooltips";
import type { KeyboardEvent } from "react";
import { type KeyboardEvent } from "react";
import styled from "styled-components";
import type { AttachedFile } from "./useAttachedFiles";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -55,7 +55,17 @@ export function FileListItem({

return (
<FileList.Item>
<File type="generic" title={fileName} onKeyDown={handleFileKeyDown}>
<File
type="generic"
title={fileName}
tabIndex={0}
aria-label={t(
"new-request-form.attachemnts.file",
"File: {{fileName}}, press delete to remove",
{ fileName }
)}
onKeyDown={handleFileKeyDown}
>
{file.status === "pending" ? (
<>
<FileNameWrapper>{fileName}</FileNameWrapper>
Expand Down
5 changes: 5 additions & 0 deletions src/modules/new-request-form/translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ parts:
title: "[A11Y] Hidden label for screen readers for the upload attachment progress bar. {{fileName}} will be replaced by file name, e.g., [image.png]. Alternative English if you encounter declension issues: [Uploading the file {{fileName}}]"
screenshot: "https://drive.google.com/file/d/1Y6yeqp3fbfJbuq7tT8VutsLa80GZju-V/view?usp=drive_link"
value: "Uploading {{fileName}}"
- translation:
key: "new-request-form.attachemnts.file"
title: "[A11Y] Hidden label for screen readers informing how they can remove the file with keyboard navigation. {{fileName}} will be replaced by file name, e.g., [image.png]. Alternative English if you encounter declension issues: [Press Delete to remove the file {{fileName}}]"
screenshot: "https://drive.google.com/file/d/1JFVE2twzUkg-U6gGAs2EHqD-3jPvtJDA/view?usp=drive_link"
value: "File: {{fileName}}, press delete to remove"
- translation:
key: "new-request-form.submit"
title: "Submit button for the New Request Form"
Expand Down

0 comments on commit 7f80ffc

Please sign in to comment.