Skip to content
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

ADA-1065-Added aria-labelby attribute to the dialog #896

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RazvanBrinzoiK05
Copy link
Collaborator

@RazvanBrinzoiK05 RazvanBrinzoiK05 commented Jun 26, 2024

Description of the Changes

Issue:

Accessibility change that was required for announcing the dialog according to it's title.

Fix:

Added aria-labelledby to associate the dialog with the descriptive title, improving accessibility for screen reader users.

Resolves ADA-1065

@@ -75,7 +75,7 @@ class MainCaptionsWindow extends Component<any, any> {
render(props: any): VNode<any> {
return (
<div className={[style.overlayScreen, style.active].join(' ')}>
<h2 className={style.title}>
<h2 className={style.title} id="captionsDialogTitle">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to avoid using id ?
id should be unique for the page, but we can have multiple players on a single page

Copy link
Collaborator Author

@RazvanBrinzoiK05 RazvanBrinzoiK05 Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the dialog has a visible title and it must be referenced with aria-labelledby that must point to the title id. If the title would be missing we could've used just an aria-label property that doesn't use id.

Should I find a way to create a dynamic id so that each player has a unique one ?

@@ -140,7 +140,7 @@ class Overlay extends Component<any, any> {
}

return (
<div tabIndex={-1} className={overlayClass.join(' ')} role="dialog" onKeyDown={this.onKeyDown} aria-label={label}>
<div tabIndex={-1} className={overlayClass.join(' ')} role="dialog" onKeyDown={this.onKeyDown} aria-labelledby="captionsDialogTitle">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does tooltip still work if aria-label is removed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, works the same as before.

@@ -138,7 +138,6 @@ class CVAAOverlay extends Component<any, any> {
addAccessibleChild={this.props.addAccessibleChild}
onClose={props.onClose}
type="cvaa"
label={props.cvvaDialogText}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label was passed as a prop just for the aria-label property that was replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants