Skip to content

Commit e1a61a2

Browse files
jeff-phillips-18cdcabrera
authored andcommitted
fix(pfWizard): Make wizard buttons keyboard accessible (#616)
Fixes #603
1 parent 1b8b540 commit e1a61a2

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

src/wizard/wizard.component.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ angular.module('patternfly.wizard').component('pfWizard', {
589589
// Save the step you were on when next() was invoked
590590
var index = stepIdx(ctrl.selectedStep);
591591

592+
callback = callback || ctrl.nextCallback;
593+
592594
if (ctrl.selectedStep.substeps) {
593595
if (ctrl.selectedStep.next(callback)) {
594596
return;
@@ -625,6 +627,7 @@ angular.module('patternfly.wizard').component('pfWizard', {
625627

626628
ctrl.previous = function (callback) {
627629
var index = stepIdx(ctrl.selectedStep);
630+
callback = callback || ctrl.backCallback;
628631

629632
if (ctrl.selectedStep.substeps) {
630633
if (ctrl.selectedStep.previous(callback)) {

src/wizard/wizard.html

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,34 @@ <h3 class="blank-slate-pf-main-action">{{$ctrl.loadingWizardTitle}}</h3>
2929
<div class="wizard-pf-position-override" ng-transclude ></div>
3030
</div>
3131
<div class="modal-footer wizard-pf-footer wizard-pf-position-override" ng-class="{'wizard-pf-footer-inline': $ctrl.embedInPage}">
32-
<pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel"
33-
ng-class="{'wizard-pf-cancel-no-back': $ctrl.hideBackButton}"
34-
ng-disabled="$ctrl.wizardDone" ng-click="$ctrl.onCancel()"
35-
ng-if="!$ctrl.embedInPage">{{$ctrl.cancelTitle}}</pf-wiz-cancel>
32+
<button ng-if="!$ctrl.embedInPage"
33+
class="btn btn-default btn-cancel wizard-pf-cancel"
34+
ng-class="{'wizard-pf-cancel-no-back': $ctrl.hideBackButton}"
35+
ng-disabled="$ctrl.wizardDone"
36+
ng-click="$ctrl.onCancel()">
37+
{{$ctrl.cancelTitle}}
38+
</button>
3639
<div ng-if="!$ctrl.hideBackButton" class="tooltip-wrapper" uib-tooltip="{{$ctrl.prevTooltip}}" tooltip-placement="left">
37-
<pf-wiz-previous id="backButton"
38-
class="btn btn-default"
39-
ng-disabled="!$ctrl.wizardReady || $ctrl.wizardDone || !$ctrl.selectedStep.prevEnabled || $ctrl.firstStep"
40-
callback="$ctrl.backCallback">{{$ctrl.backTitle}}</pf-wiz-previous>
40+
<button id="backButton"
41+
class="btn btn-default"
42+
ng-disabled="!$ctrl.wizardReady || $ctrl.wizardDone || !$ctrl.selectedStep.prevEnabled || $ctrl.firstStep"
43+
ng-click="$ctrl.previous()">
44+
{{$ctrl.backTitle}}
45+
</button>
4146
</div>
4247
<div class="tooltip-wrapper" uib-tooltip="{{$ctrl.nextTooltip}}" tooltip-placement="left">
43-
<pf-wiz-next id="nextButton"
44-
class="btn btn-primary wizard-pf-next"
45-
ng-disabled="!$ctrl.wizardReady || !$ctrl.selectedStep.nextEnabled"
46-
callback="$ctrl.nextCallback">{{$ctrl.nextTitle}}</pf-wiz-next>
48+
<button id="nextButton"
49+
class="btn btn-primary wizard-pf-next"
50+
ng-disabled="!$ctrl.wizardReady || !$ctrl.selectedStep.nextEnabled"
51+
ng-click="$ctrl.next()">
52+
{{$ctrl.nextTitle}}
53+
</button>
4754
</div>
48-
<pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel wizard-pf-cancel-inline"
49-
ng-disabled="$ctrl.wizardDone"
50-
ng-click="$ctrl.onCancel()"
51-
ng-if="$ctrl.embedInPage">{{$ctrl.cancelTitle}}</pf-wiz-cancel>
55+
<button ng-if="$ctrl.embedInPage"
56+
class="btn btn-default btn-cancel wizard-pf-cancel wizard-pf-cancel-inline"
57+
ng-disabled="$ctrl.wizardDone"
58+
ng-click="$ctrl.onCancel()">
59+
{{$ctrl.cancelTitle}}
60+
</button>
5261
</div>
5362
</div>

0 commit comments

Comments
 (0)