-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
ADA-1065-Added aria-labelby attribute to the dialog #896
Conversation
@@ -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"> |
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.
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
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.
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"> |
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.
does tooltip still work if aria-label is removed ?
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.
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} |
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.
why remove it ?
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.
The label was passed as a prop just for the aria-label property that was replaced.
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