Skip to content

Commit 94eaa92

Browse files
committed
FORMS-18686: Button: Button is missing both a role and a name @sunnym @vavarshn
1 parent 84d1c47 commit 94eaa92

File tree

2 files changed

+8
-0
lines changed
  • ui.af.apps/src/main/content/jcr_root/apps/core/fd
    • af-clientlibs/core-forms-components-runtime-all/resources/i18n
    • components/form/datepicker/v1/datepicker/clientlibs/site/js

2 files changed

+8
-0
lines changed

ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/resources/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"accept" : "The specified file type not supported.",
2323
"defaultError" : "There is an error in the field",
2424
"clearText" : "Clear",
25+
"openCalendarText" : "Open calendar",
2526
"calendarSymbols" : {
2627
"monthNames" : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
2728
"abbrmonthNames" : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ if (typeof window.DatePickerWidget === 'undefined') {
6666
months: ["January","February","March","April","May","June","July","August","September","October","November","December"],
6767
zero: "0",
6868
clearText: "Clear",
69+
openCalendarText: "Open calendar",
6970
name: "en_US"
7071
},
7172
format: "YYYY-MM-DD",
@@ -311,6 +312,8 @@ if (typeof window.DatePickerWidget === 'undefined') {
311312

312313
let calendarIcon = document.createElement("div");
313314
calendarIcon.classList.add("cmp-adaptiveform-datepicker__calendar-icon");
315+
calendarIcon.setAttribute("role", "button");
316+
calendarIcon.setAttribute("aria-label", this.#options.locale.openCalendarText);
314317

315318
widget.parentNode.insertBefore(calendarIcon, widget.nextSibling);
316319

@@ -1152,6 +1155,10 @@ if (typeof window.DatePickerWidget === 'undefined') {
11521155
if (clearText) {
11531156
defaultOptions.locale.clearText = clearText;
11541157
}
1158+
var openCalendarText = FormView.LanguageUtils.getTranslatedString(locale, "openCalendarText");
1159+
if (openCalendarText) {
1160+
defaultOptions.locale.openCalendarText = openCalendarText;
1161+
}
11551162
var zero = FormView.LanguageUtils.getTranslatedString(locale, "0");
11561163
if (zero) {
11571164
defaultOptions.locale.zero = zero;

0 commit comments

Comments
 (0)