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: add missing role attribute #19870

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@
></cx-tab>
</div>
<div aria-live="assertive" aria-atomic="true">
<span *ngIf="validationError" tabindex="0" class="cx-invalid-message">
<span
*ngIf="validationError"
role="alert"
tabindex="0"
class="cx-invalid-message"
>
{{ validationError | cxTranslate }}
</span>
</div>
Comment on lines 180 to 189
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the aria-live="assertive" aria-atomic="true" since role alert provides the same functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since *ngIf and role="alert" doesn't really fit to each other - if we create an element with role alert it is not announced, only when it content changes.

So for that container div has <div aria-live="assertive" aria-atomic="true">. And role alert on the span is just to suppress AMP warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know if there is better way that would work?

Expand Down
Loading