-
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?
Changes from all commits
6101e9b
bc138e5
28bd40d
9ebddd9
5694062
f6235c9
230f078
4439696
6057d1f
84a509a
fb3dcba
691b15f
9efa603
72993d3
8f92f11
b4afb92
dac9aca
50a2631
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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" | ||||||
class="signpost-action close" | ||||||
(click)="close()" | ||||||
[attr.aria-controls]="signpostContentId" | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Can we just use it as a default value?
Suggested change
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. See my other comment for why defaulting to the common string in the template is better (and consistent with existing code). #1624 (comment) |
||||||
|
||||||
signpostContentId = uniqueIdFactory(); | ||||||
|
||||||
private document: Document; | ||||||
|
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.
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.
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.
@dtsanevmw They want to custom aria label with name of trigger element, so current implementation is better and we are using same pattern in other places also.