Datepicker has the same problem as do the dialogs generated by jquery-ui:
1. the widgit adds content to the end of the dom
2. the new content is never focused automatically
3. no live regions are used to alert the user that new content has appeared
Unlike accordion or tabs, the events provided do not get control early
enough to make modifications to the dom that "stick". For instance, I want
to:
1. add role="alert" to .ui-datepicker-title (i.e. elements with class
ui-datepicker-title)
2. add tabindex="0" to .ui-datepicker-title (i.e. elements with class
ui-datepicker-title)
3. set focus to the associated datepicker's div with class
ui-datepicker-title
When I make these modifications from beforeShow's event callback, and then
look at the generated source in Firefox using the web developer toolbar, the
modifications I made did not show up.
Here's the code (I set this as part of the options object when datepicker is
initialized:
$("input").datepicker ({
beforeShow: function (input, inst) {
$(".ui-datepicker-title").attr ("tabindex", "0", "role", "alert");
setTimeout (function () {
alert ($("#ui-datepicker-div").html());
}, 1000);
}, // beforeShow
...
}); // datepicker
The other issue is that if focus is moved, the datepicker closes. This could
be confusing for screen reader users, and perhaps even prevent them from
making a choice. For instance, if focus is not shifted automatically to the
datepicker instance, then in an attempt to find the calendar and select a
date, the focus might get moved somewhere outside the datepick and it will
close, preventing the user from interacting with it to make a choice.
I'd suggest the following modifications:
1. close only on select or well-defined keyboard or mouse action (not
onblurr)
2. add an event which fires after all dom objects have been created and
before the datepicker opens
Comments please...
-- Rich
Hi, I have the same problem. I found the following solution to edit the datepicker html before it's shown:
--
You received this message because you are subscribed to the Google Groups "jQuery Accessibility" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jquery-a11y...@googlegroups.com.
To post to this group, send email to jquer...@googlegroups.com.
Visit this group at http://groups.google.com/group/jquery-a11y?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.