Skip to content

Commit 1b89267

Browse files
stefan-dragomirStefan Dragomir
andauthored
FORMS-18684: Function cannot be performed by keyboard alone @sunnym @vavarshn (#1570)
* FORMS-18684: Function cannot be performed by keyboard alone @sunnym @vavarshn * FORMS-18813: Created actionKeys list --------- Co-authored-by: Stefan Dragomir <stefand@ENSRO0422.local>
1 parent 621002a commit 1b89267

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
errorDiv: `.${CheckBoxGroup.bemBlock}__errormessage`,
4141
tooltipDiv: `.${CheckBoxGroup.bemBlock}__shortdescription`,
4242
item: `.${CheckBoxGroup.bemBlock}-item`,
43-
optionLabel: `${CheckBoxGroup.bemBlock}__option-label`
43+
optionLabel: `${CheckBoxGroup.bemBlock}__option-label`,
44+
optionLink: `${CheckBoxGroup.bemBlock}__links`
4445
};
4546

4647
constructor(params) {
@@ -97,6 +98,16 @@
9798
this.setInactive();
9899
});
99100
})
101+
102+
let optionLinks = this.element.querySelectorAll(`.${CheckBoxGroup.selectors.optionLink}`);
103+
const actionKeys = ['Enter', ' ', 'Spacebar', 'Space'];
104+
optionLinks.forEach(optionLink => {
105+
optionLink.addEventListener('keydown', (e)=>{
106+
if(actionKeys.includes(e.key)) {
107+
optionLink.click();
108+
}
109+
});
110+
});
100111
}
101112

102113
#updateModelValue(widget) {

ui.frontend/src/view/FormFieldBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class FormFieldBase extends FormField {
249249
this.#syncLabel()
250250
this.#syncWidget()
251251
this.#syncShortDesc()
252-
this. #syncLongDesc()
252+
this.#syncLongDesc()
253253
this.#syncAriaDescribedBy()
254254
this.#syncError()
255255
this.#syncAriaLabel()

0 commit comments

Comments
 (0)