-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add label and aria-expanded for Javalab file options toggle button #49473
Conversation
apps/src/javalab/JavalabEditor.jsx
Outdated
@@ -714,6 +714,7 @@ class JavalabEditor extends React.Component { | |||
<span>{fileMetadata[tabKey]}</span> | |||
{activeTabKey === tabKey && !isReadOnlyWorkspace && ( | |||
<button | |||
aria-label="File options" |
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.
nit: this string should be translatable
apps/src/javalab/JavalabEditor.jsx
Outdated
@@ -714,6 +714,8 @@ class JavalabEditor extends React.Component { | |||
<span>{fileMetadata[tabKey]}</span> | |||
{activeTabKey === tabKey && !isReadOnlyWorkspace && ( | |||
<button | |||
aria-label={i18n.fileOptions()} | |||
aria-expanded={contextTarget === tabKey ? true : false} |
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.
(this logic is copied from ~10 lines below). i could also simplify it to contextTarget === tabKey
, i'm not sure which is more readable.
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.
i think contextTarget === tabKey
is more readable
Add a label to the file explorer button in Javalab. I used what looked like the simplest approach in this article on accessible icon buttons, and a label text that matches the behavior of the button. Let me know if you think I should change any of that!
Links