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

fix(a11y): signpost close aria label update and allow user to config aria label #1624

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

spadidapelli
Copy link
Contributor

@spadidapelli spadidapelli commented Nov 26, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If applicable, have a visual design approval

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: CDE-2461

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Contributor

github-actions bot commented Nov 26, 2024

👋 @spadidapelli,

  • 🙏 The Clarity team thanks you for opening a pull request
  • 🎉 The build for this PR has succeeded
  • 🔍 The PR is now ready for review
  • 🍿 In the meantime, view a preview of this PR
  • 🖐 You can always follow up here. If you're a VMware employee, you can also reach us on our internal Clarity Support space

Thank you,

🤖 Clarity Release Bot

@spadidapelli spadidapelli requested a review from a team November 27, 2024 05:13
@spadidapelli spadidapelli self-assigned this Nov 27, 2024
@@ -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;
Copy link
Contributor

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?

Suggested change
@Input('clrSignpostCloseAriaLabel') signpostCloseAriaLabel: string;
@Input('clrSignpostCloseAriaLabel') signpostCloseAriaLabel = this.commonStrings.keys.signpostClose;

Copy link
Member

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[attr.aria-label]="signpostCloseAriaLabel || commonStrings.keys.signpostClose"
[attr.aria-label]="signpostCloseAriaLabel"

Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

5 participants