I'm making an app using Kendo and need to make it Section 508 compliant and accessible. One of the issues i'm having is that when a user navigates to a new page after clicking on a ListView item, the focus needs to change to the top title bar, but that's not working when I use ListView. I tell the focus to change in the data-after-show method of each page. It works if I go to the page via a KendoMobileButton or Kendo Tab bar button, but not for a ListView item. Here is my data-after-show method:
function
setFocusToTop() {
//first, since header is dynamically generated,we need to find the current page title element.
var
id = app.view().wrapper[0].attributes[
'id'
].value;
var
newId = id +
"-hTitle"
;
//give it an ID so we're 100% sure we're only finding the right one...not necessary, but worth the attempt.
$(
'#'
+ id +
' .viewTitleStyle:visible'
).attr(
'id'
, newId);
//give it a tabindex since it's not an input control. this lets us focus it
$(
'#'
+ newId).attr(
'tabindex'
,
'-1'
);
$(
'#'
+ newId).focus();
}
And here are my templates for my listview:
<script type=
"text/x-kendo-template"
id=
"customListViewNoDescriptionTemplate"
>
<div class=
"km-listview-link noDesc"
role=
"button"
>
<div class=
"graphic-container"
><img class=
"item-photo"
src=
"${image}"
aria-hidden=
"true"
/></div>
<h3 class=
"item-title"
>${name}</h3>
</div>
</script>
And here is how I create/bind the listview with that template:
$(
"#myHome-listview"
).kendoMobileListView({
dataSource: myDataSource,
template: $(
"#customListViewNoDescriptionTemplate"
).html(),
click: listViewLinkClick
});
I'm testing using Cordova on an iPhone using iOS9+ with VoiceOver turned on. Does anyone have any advice as to how to modify my ListView binding or template so that the focus event will work?