Skip to content

Commit fdea8c2

Browse files
authored
14744 tour not coded to best practice (#15133)
* Apply focusLockService to TourStepDirective Apply focusLockService to TourStepDirective in order to ensure that non-modal page contents are inert and do not interfere with focus on modal dialog with regards to screen reading technologies. * Add properties to umb-tour.html. Add properties to umb-tour html page to ensure that it aligns with modal dialog best practices. * Add dialog properties to Umbraco tour .html files. Add properties relating to dialog and accessibility to the Umbraco tour .html files, including aria-label, role, and tab index.
1 parent ce372ab commit fdea8c2

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour/umbtourstep.directive.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@
1414
(function () {
1515
'use strict';
1616

17-
function TourStepDirective() {
17+
function TourStepDirective(focusLockService) {
1818

1919
function link(scope, element, attrs, ctrl) {
2020

2121
scope.close = function () {
2222
if (scope.onClose) {
23-
scope.onClose();
23+
scope.onClose();
24+
focusLockService.removeInertAttribute();
2425
}
2526
}
2627

28+
focusLockService.addInertAttribute();
2729
}
2830

2931
var directive = {

src/Umbraco.Web.UI.Client/src/views/components/application/umb-tour.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="umb-tour">
1+
<div class="umb-tour" tabindex="0" role="dialog" aria-label="tour">
22

33
<umb-loader class="umb-tour__loader" ng-if="loadingStep"></umb-loader>
44

@@ -29,7 +29,7 @@
2929
total-steps="model.steps.length">
3030
</umb-tour-step-counter>
3131
<div ng-if="model.allowDisable && model.currentStep.type === 'intro'">
32-
<button type="button" class="underline" ng-click="model.disableTour()" prevent-default>Don't show this tour again</button>
32+
<button type="button" class="underline" ng-click="model.disableTour()" tabindex="0" prevent-default>Don't show this tour again</button>
3333
</div>
3434
</div>
3535

@@ -58,7 +58,7 @@ <h3 class="bold">Congratulations!</h3>
5858
</umb-tour-step-content>
5959

6060
<umb-tour-step-footer>
61-
<umb-button type="button" button-style="action" size="m" action="model.completeTour()" label="Complete"></umb-button>
61+
<umb-button type="button" button-style="action" size="m" action="model.completeTour()" label="Complete" tabindex="0"></umb-button>
6262
</umb-tour-step-footer>
6363

6464
</umb-tour-step>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div class="umb-tour-step__content">
2-
<div ng-bind-html="content"></div>
2+
<div ng-bind-html="content" tabindex="0"></div>
33
<div ng-transclude></div>
4-
</div>
4+
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="umb-tour-step__counter">{{ currentStep }}/{{ totalSteps }}</div>
1+
<div class="umb-tour-step__counter" tabindex="0">{{ currentStep }}/{{ totalSteps }}</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div class="umb-tour-step__header">
2-
<div class="umb-tour-step__title">{{title}}</div>
2+
<div class="umb-tour-step__title" id="step-title" tabindex="0">{{title}}</div>
33
<div ng-transclude></div>
4-
</div>
4+
</div>

0 commit comments

Comments
 (0)