Hi,
We are using the progress functionality across the applications, also its inbuilt in Grids/Tree View or most of the Kendo controls when data is loading. Now we are hit with an Accessibility issue as stated below in JAWS 2019.
"Issue: There is a loading screen that appears throughout the application. Sighted users are able to see the loading indicator, however, screen reader users should also be aware of the loading screen."
this is what we use explicitly in some places other than the inbuilt loading indicator.
// show loading indicator kendo.ui.progress($("#divCriteria"), true);
So is there any settings available that we can make this screen readable when the progress bar appears? meaning if we setup globally once place it takes care across everywhere? Including Grids / Treeview etc.
I read setting this role=” aria-busy=” will do the job, but this functionality already have the kendo scripts?
<div role="alert" aria-busy="alert"> Data is loading... </div>
Appreciate a quick response or solution for this...
Thanks
Sree
$.extend(kendo.ui, {
progress:
function
(container, toggle, options) {
var
mask = container.find(
".k-loading-mask"
),
support = kendo.support,
browser = support.browser,
isRtl, leftRight, webkitCorrection, containerScrollLeft, cssClass;
options = $.extend({}, {
width:
"100%"
,
height:
"100%"
,
top: container.scrollTop(),
opacity:
false
}, options);
cssClass = options.opacity ?
'k-loading-mask k-opaque'
:
'k-loading-mask'
;
if
(toggle) {
if
(!mask.length) {
isRtl = support.isRtl(container);
leftRight = isRtl ?
"right"
:
"left"
;
containerScrollLeft = container.scrollLeft();
webkitCorrection = browser.webkit ? (!isRtl ? 0 : container[0].scrollWidth - container.width() - 2 * containerScrollLeft) : 0;
mask = $(kendo.format(
"<div class='{0}'><span class='k-loading-text' role='alert' aria-busy='alert'>{1}</span><div class='k-loading-image'/><div class='k-loading-color'/></div>"
, cssClass,
"Please wait data is loading"
))
.width(options.width).height(options.height)
.css(
"top"
, options.top)
.css(leftRight, Math.abs(containerScrollLeft) + webkitCorrection)
.prependTo(container);
}
}
else
if
(mask) {
mask.remove();
}
}
});
Is there a way if I could override the kendo.ui.progress method and make those attribute insertion there? So the change will stay in one place?
If the span had the following attribute it works as expected. unfortunately, its in the minimized Kendo JS and not a good idea we are editing the same. Because when the next Kendo upgrade comes in we loose those changes.
<span class="k-loading-text" role="alert" aria-busy="alert">Please wait data is loading</span>
So wherever I am calling kendo.ui.progress, I insert the below three attributes. ( sad part is we have so many places it is being called )
kendo.ui.progress($(".form-group"), true); $("span.k-loading-text").attr("role", "alert"); $("span.k-loading-text").attr("aria-busy", "alert"); $("span.k-loading-text").text("Please wait data is loading");
As far as Grid/Tree-view concerned , I am yet to do that and test. Will update if it works as expected.
The bottom line is, if the Kendo script had those aria role attributes we didn't had to do this workaround.
Thanks
Sree
Hello Alex, Yes please, you may make it as public.