Skip to content

Commit fb9ff86

Browse files
stefan-dragomirStefan Dragomir
andauthored
FORMS-18813: Function cannot be performed by keyboard alone @sunnym @vavarshn (#1591)
* FORMS-18813: Function cannot be performed by keyboard alone @sunnym @vavarshn * FORMS-18813: removing extra role added accidentally * FORMS-18813: Checking the key on keydown only, adding more key codes * FORMS-18813: Created actionKeys list --------- Co-authored-by: Stefan Dragomir <stefand@ENSRO0422.local>
1 parent 1b89267 commit fb9ff86

File tree

1 file changed

+13
-7
lines changed
  • ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/wizard/v1/wizard/clientlibs/site/js

1 file changed

+13
-7
lines changed

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/wizard/v1/wizard/clientlibs/site/js/wizardview.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,20 @@
127127
*/
128128
#bindEvents() {
129129
const _self = this;
130-
this.getNextButtonDiv().addEventListener("click", function (event) {
131-
_self.#navigateToNextTab();
132-
})
133-
this.getPreviousButtonDiv().addEventListener("click", function (event) {
134-
_self.#navigateToPreviousTab();
135-
})
136-
130+
const actionKeys = ['Enter', ' ', 'Spacebar', 'Space'];
137131

132+
["click", "keydown"].forEach(function(event){
133+
_self.getNextButtonDiv().addEventListener(event, function(event){
134+
if (event.type ==='click' || (event.type === 'keydown' && actionKeys.includes(event.key))) {
135+
_self.#navigateToNextTab();
136+
}
137+
});
138+
_self.getPreviousButtonDiv().addEventListener(event, function(event){
139+
if (event.type ==='click' || (event.type === 'keydown' && actionKeys.includes(event.key))) {
140+
_self.#navigateToPreviousTab();
141+
}
142+
});
143+
})
138144
}
139145

140146
/**

0 commit comments

Comments
 (0)