-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add aria-label for removing attachment in new request form #543
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -55,13 +55,26 @@ export function FileListItem({ | |||||||||||||||||||||||
|
||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||
<FileList.Item> | ||||||||||||||||||||||||
<File type="generic" title={fileName} onKeyDown={handleFileKeyDown}> | ||||||||||||||||||||||||
<File | ||||||||||||||||||||||||
type="generic" | ||||||||||||||||||||||||
tabIndex={0} | ||||||||||||||||||||||||
aria-label={t( | ||||||||||||||||||||||||
"new-request-form.attachments.file", | ||||||||||||||||||||||||
"File: {{fileName}}, press delete to remove", | ||||||||||||||||||||||||
{ fileName } | ||||||||||||||||||||||||
)} | ||||||||||||||||||||||||
onKeyDown={handleFileKeyDown} | ||||||||||||||||||||||||
> | ||||||||||||||||||||||||
{file.status === "pending" ? ( | ||||||||||||||||||||||||
<> | ||||||||||||||||||||||||
<FileNameWrapper>{fileName}</FileNameWrapper> | ||||||||||||||||||||||||
<Tooltip content={stopUploadLabel}> | ||||||||||||||||||||||||
<File.Close | ||||||||||||||||||||||||
aria-label={stopUploadLabel} | ||||||||||||||||||||||||
aria-label={t( | ||||||||||||||||||||||||
"new-request-form.attachments.stop-upload-aria-label", | ||||||||||||||||||||||||
"Stop uploading {{fileName}}", | ||||||||||||||||||||||||
{ fileName } | ||||||||||||||||||||||||
)} | ||||||||||||||||||||||||
onClick={() => { | ||||||||||||||||||||||||
onRemove(); | ||||||||||||||||||||||||
}} | ||||||||||||||||||||||||
|
@@ -86,7 +99,11 @@ export function FileListItem({ | |||||||||||||||||||||||
</FileNameWrapper> | ||||||||||||||||||||||||
<Tooltip content={removeFileLabel}> | ||||||||||||||||||||||||
<File.Delete | ||||||||||||||||||||||||
aria-label={removeFileLabel} | ||||||||||||||||||||||||
aria-label={t( | ||||||||||||||||||||||||
"new-request-form.attachments.remove-file-arria-label", | ||||||||||||||||||||||||
"Remove file: {{fileName}}", | ||||||||||||||||||||||||
{ fileName } | ||||||||||||||||||||||||
)} | ||||||||||||||||||||||||
Comment on lines
+102
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please add
Suggested change
(The word "button" comes from it being an HTML button element.) |
||||||||||||||||||||||||
onClick={() => { | ||||||||||||||||||||||||
onRemove(); | ||||||||||||||||||||||||
}} | ||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add
aria-describedby={undefined}
to avoid a duplicate screen reader announcement here, too?(The word "button" comes from it being an HTML button element.)