Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

574 adding keyboard accessibility to the facet expanders #585

Closed
wants to merge 3 commits into from
Closed

574 adding keyboard accessibility to the facet expanders #585

wants to merge 3 commits into from

Conversation

deborahgu
Copy link

Bug #574 :

Adding a tab index and a button role to the h3 that constitutes the expandable facet header to enable keyboard navigation. Using the role button rather than link because the W3C recommends that if it doesn't change focus or page -- http://www.w3.org/TR/wai-aria/roles#link

Adding a keypress handler for pressing "enter" on that header, as well as a click handler.

@@ -31,6 +31,13 @@ Blacklight.do_facet_expand_contract_behavior = function() {
$(this).toggleClass('twiddle-open');
$(f_content).slideToggle();
});
$('h3', f_content.parent()).keypress(function(e){
if (e.keyCode == 13) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment about what keycode 13 is (enter, I assume?)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we were able to accomplish this in SearchWorks by putting an anchor inside the h3 and then adding the click event to both the h3 and the anchor so if the anchor has focus the enter key will automatically be able to expand/collapse the facet as that mimics a click.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.. And, presumably, works without javascript?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I like that. It's cleaner and addresses a weird bug we fought with semi-successfully on Opera, and requires no tabindex or role. Tested in O, FF, S, IE.

(W/JS off the facets just auto expand, which is probably correct behaviour, at least from my NoScript-using perspective.)

Deborah Kaplan added 2 commits August 9, 2013 20:10
… have a keypress handler & puts the element in the tabindex. Modifying the JS to activate on a rather than h3
…ed; adding back js on the h5 for styled blocks of header
@deborahgu
Copy link
Author

Huh. I'm going to redo this against an updated master; other things HAVE changed. Grr argh.

@cbeer
Copy link
Member

cbeer commented Aug 19, 2013

I've taken @jkeck's proposal and merged it in dee733a

@cbeer cbeer closed this Aug 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants