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

Add aria-live to let screen readers announce notifications #6406

Merged
merged 1 commit into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
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 @@ -14,7 +14,7 @@
list-style: none;
margin: 0;
position: relative;
}
}

.umb-notifications__notification {
padding: 5px 20px;
Expand All @@ -24,11 +24,14 @@
position: relative;
border-radius: 10px;
margin: 10px;

.close {
position: absolute;
top: 0;
right: -6px;
bottom: 0;
right: 6px;
opacity: 0.4;
margin: auto 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<div class="umb-notifications" id="umb-notifications-wrapper" ng-cloak>
<ul class="umb-notifications__notifications">
<ul class="umb-notifications__notifications" aria-live="assertive" aria-relevant="additions">
<li ng-repeat="notification in notifications"
class="alert alert-block alert-{{notification.type}} umb-notifications__notification animated -half-second fadeIn"
ng-class="{'-no-border -extra-padding': notification.type === 'form'}">

<a class='close -align-right' ng-click="removeNotification($index)" prevent-default href>&times;</a>

<div ng-if="notification.view">
<div ng-include="notification.view"></div>
</div>
Expand All @@ -19,6 +17,10 @@
<span ng-bind-html="notification.message"></span>
</div>
</div>

<button type="button" class='close -align-right' ng-click="removeNotification($index)" aria-hidden="true">
<span aria-hidden="true">&times;</span>
</button>
</li>
</ul>
</div>