-
Notifications
You must be signed in to change notification settings - Fork 80
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(a11y): signpost close aria label update and allow user to config aria label #1624
base: main
Are you sure you want to change the base?
Conversation
Thank you, 🤖 Clarity Release Bot |
@@ -56,6 +56,8 @@ const POSITIONS: string[] = [ | |||
host: { '[class.signpost-content]': 'true', '[id]': 'signpostContentId' }, | |||
}) | |||
export class ClrSignpostContent extends AbstractPopover implements OnDestroy { | |||
@Input('clrSignpostCloseAriaLabel') signpostCloseAriaLabel: string; |
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 just use it as a default value?
@Input('clrSignpostCloseAriaLabel') signpostCloseAriaLabel: string; | |
@Input('clrSignpostCloseAriaLabel') signpostCloseAriaLabel = this.commonStrings.keys.signpostClose; |
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.
See my other comment for why defaulting to the common string in the template is better (and consistent with existing code). #1624 (comment)
@@ -40,7 +40,7 @@ const POSITIONS: string[] = [ | |||
<div class="signpost-content-header"> | |||
<button | |||
type="button" | |||
[attr.aria-label]="commonStrings.keys.signpostClose" | |||
[attr.aria-label]="signpostCloseAriaLabel || commonStrings.keys.signpostClose" |
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.
[attr.aria-label]="signpostCloseAriaLabel || commonStrings.keys.signpostClose" | |
[attr.aria-label]="signpostCloseAriaLabel" |
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 current implementation is better so that we default to the common string if a falsy value is bound to the input. This is a pattern we use in several places, and I think this one should be the same.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: CDE-2461
What is the new behavior?
Does this PR introduce a breaking change?
Other information