Problem/Motivation

UI is not accessible to keyboard only users

Proposed resolution

Fix jquery.treeTable library

Remaining tasks

Fixing this upstream on https://github.com/ludo/jquery-treetable means we need a way to fix all d.o. changes.

#848650: Help arrows in wrong state and to far to the left in help
This uses drupal images instead of default

#1062492: Multiple token trees on same page can both get expanded when clicking one
This is committed https://github.com/ludo/jquery-treetable/commit/769e1bd7a181f88fa0cdc153...

A trivial fixing whitespace : http://drupalcode.org/project/token.git/commit/49e495928fe0a90455f0f19ea...

User interface changes

Arrow images are foreground images with a title and alt.

Original report by Everett Zufelt

// Text of original report here.(for legacy issues whose initial post was not the issue summary)On the account configuration page admin/config/people/accounts tokens are grouped into a table with collapsedrows. It does not appear possible to expand the rows without using a mouse or other pointing device.

This means that keyboard only users are unable to reveal and use the tokens.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Everett Zufelt’s picture

This behavior is controlled by a jQuery UI plugin

http://plugins.jquery.com/project/treeTable

With JS disabled the tokens still appear not to be focusable. Would be best if the tokens and row expand / collapse controls were anchors (which natively receive keyboard focus). And that they are styled so that it is visually perceivable when they receive focus.

manarth’s picture

Status: Active » Needs review
FileSize
998 bytes

The attached patch changes the JQuery library:
- the expand/collapse controls become links instead of spans, so they can gain focus
- the controls can be triggered by [ENTER] keypress (in addition to click)

Everett Zufelt’s picture

Issue tags: +Accessibility
manarth’s picture

This second patch adds the following features:
- when you tab to a tree-control, it displays as Bold
- a title ("Expand" or "Collapse") is applied to the control, and changes as the control is triggered. This title-label is applied via drupal.t() so it meets i18n standards.

Everett Zufelt’s picture

This patch applied without a problem.

The links to expand and collapse tree table rows are now operable with the keyboard and inserting tokens is also operable with the keyboard.

the "expand" and "collapse" text is not being read by screen-reader as there is anchor text in the anchor. I should have thought of this before. Only real option is hidden text within the anchor, before or after the anchor, to indicate the state. This is why the use of background images should be reserved for background images, and not icons, which by their essence are in the foreground.

manarth’s picture

the "expand" and "collapse" text is not being read by screen-reader as there is anchor text in the anchor.

Fair point.

Adding these as foreground images will be difficult, because it's a library JS file, which makes getting the path to the images difficult. Instead I've added a hidden with the relevant text.

Dave Reid’s picture

Title: The tree table on the account configuration page is not accessible to keyboard only users » The token tree UI is not accessible to keyboard only users
greggles’s picture

Based on Everett's last comment "This is why the use of background images should be reserved for background images, and not icons, which by their essence are in the foreground." it seems like we should attack this in a slightly different way.

What do you think, manarth, are you up to rebuild this to put the images in the foreground?

manarth’s picture

are you up to rebuild this to put the images in the foreground?

Back in September, I didn't think this was possible. I'm pleased to find that I was wrong :-)

The problem is that it's tricky to work out the path to the images. TreeTable is an external project, and if we'd like to contribute the patch back, we can't rely on Drupal APIs. Relative paths work fine in CSS, but I can't find a reliable way for a JavaScript function to work out which JavaScript file provided it (and use that to calculate the path to the image).

The solution I've come up with is to leave the background images in css, and position them outside the element so they're not visible. The TreeTable library then looks for the background images on the element (where the JavaScript API provides the absolute path to the images), and copies them to foreground images.

Patch attached for review.

Status: Needs review » Needs work
Issue tags: -Accessibility

The last submitted patch, 922022.accessible_library-ver4.patch, failed testing.

manarth’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: -Accessibility

The last submitted patch, 922022.accessible_library-ver4.patch, failed testing.

greggles’s picture

Status: Needs work » Needs review
Issue tags: +Accessibility
greggles’s picture

Test failures were client issues. Requed.

Thanks manarth!

Status: Needs review » Needs work
Issue tags: -Accessibility

The last submitted patch, 922022.accessible_library-ver4.patch, failed testing.

manarth’s picture

Status: Needs work » Needs review
Issue tags: +Accessibility
Dave Reid’s picture

mohammed76’s picture

can't we at least commit part of the code in number 4 that makes it possible for The links to expand and collapse tree table rows and insert tokens operable with the keyboard? that is until the issue filed against the library is being looked into?

that functionality alone will be very appreciated for keyboard only users.

Jim Ruby’s picture

subscribe

Jim Ruby’s picture

Just curious what the status on this might be? I have not seen any activity onthis in a wile and hope something could be done.

greggles’s picture

http://plugins.jquery.com/content/ui-not-accessible-keyboard-only-users has had no progress. Until/unless that has progress I guess there is no progress?

Dave Reid’s picture

The jquery issue tracker is a black hole. Likely the issue needs to be filed in https://github.com/ludo/jquery-treetable/issues now.

Everett Zufelt’s picture

Dave Reid’s picture

It would really be great if we could get someone to help do a clone of the library and provide a pull request with the fixes required. Adding the blocker tag for now.

mohammed76’s picture

what about the suggestion to commit number 4 temporarily until the issue is being looked into upstream?

clemens.tolboom’s picture

I could not apply the patch. So attached a hand applied patch.

Fixed one global var.

clemens.tolboom’s picture

Comparing the token version with the jquery-treeTable version 2.3.0 there are apart from the intended patch two diffs puzzling me.

   function childrenOf(node) {
-    return $("table.treeTable tbody tr." + options.childPrefix + node[0].id);
+    return $(node).siblings("tr." + options.childPrefix + node[0].id);
   };

Part of commit : d3d91ddb (Dave Reid         2011-07-26 14:33:58 -0500 158)     return $(node).siblings("tr." + options.childPrefix + node[0].id);

and

     for(key in classNames) {
       if(classNames[key].match(options.childPrefix)) {
-        return $("#" + classNames[key].substring(9));
+        return $(node).siblings("#" + classNames[key].substring(options.childPrefix.length));
       }
     }

Part of commit : d3d91ddb (Dave Reid         2011-07-26 14:33:58 -0500 235)         return $(node).siblings("#" + classNames[key].substring(options.childPrefix.length));
clemens.tolboom’s picture

Still searching ... but this whitespace cleaning is not helping either
http://drupalcode.org/project/token.git/blobdiff/e20da62fe103dde65f7ae80...

clemens.tolboom’s picture

clemens.tolboom’s picture

clemens.tolboom’s picture

Issue summary: View changes

Added issue summary to describe what to do upstream.

clemens.tolboom’s picture

clemens.tolboom’s picture

Testing the added functionality did not give me keyboard access to the token tree. So could keyboard only users use these foreground images?

Image shows a mouse clicked token tree item

tokens

Checking ie http://www.usability.com.au/resources/tables.cfm did not help.

I expected the patch should help navigate between ie admin/config/people/accounts body text field and the token tree. But a tab jumps strait to the 'Save configuration'

The text above the token table

Click a token to insert it into the field you've last clicked.

needs an update too. What about: 'Select a token to insert it into the field you've last selected'

I just jumped on the issue to create a github clone of the proposed patch ... now I'm wondering whether the patches worked as designed?

Am I missing something? Is Firefox in err?

Everett Zufelt’s picture

@clemens.tolboom

Can you please provide a sample of a couple of rows of the table from the DOM after the plugin has manipulated it? As long as the clickable items are actually anchors, and have the .click() binding it should be accessible w/ keyboard.

clemens.tolboom’s picture

FileSize
75.29 KB

This item has a click and keydown handler

<a class="expander" style="margin-left: -19px; padding-left: 19px;" title="Expand" href="#"><img title="Collapse" alt="Collapse" src="http://drupal.d7/sites/default/modules/token/arrow-down.png">Current date</a>

I expected a tab stop still. There is no way for me to select a token without a mouse.

Everett Zufelt’s picture

I also expect a tabstop if using an anchor... very strange. Requires some debugging. I hope to come back to this if noone else gets to it first.

clemens.tolboom’s picture

FileSize
15.67 KB

manarth@irc ask about my os which is snow leopard. And about my settings. It came down to using setting
full keyboard access.png

So @Everett Zufelt and @manarth forget #32

I will add another comment on https://github.com/ludo/jquery-treetable/pull/30 which had a short review already.

About the other patches done on jquery-treetable. If we revert those we need to make it a library I guess.
- #848650: Help arrows in wrong state and to far to the left in help is an easy patch by allowing settings for the icon/image path
- #1062492: Multiple token trees on same page can both get expanded when clicking one is already committed on github

But it is risky to wait for a new release for jquery-treetable right?

clemens.tolboom’s picture

Response from jquery-treetable maintainer Ludo van den Boom https://github.com/ludo/jquery-treetable/pull/30#issuecomment-2808093

...
The real img made it more difficult to adhere to the styling used in the documentation (see doc/index.html) so I have chosen to keep using the CSS background-images as they were before. Is there a reason why a real img-element would be preferred?
...

His merge https://github.com/ludo/jquery-treetable/compare/master...feature-access... adds the <a> but not the foreground image

#5 and #6 say screen-readers do not read the title of an empty anchor so we add a foreground image.

Everett Zufelt’s picture

@clemens.tolboom

Just to clarify #5, screen-readers don't read anchor title attributes when there is content in the anchor. If there is no content in the anchor I believe that most screen-readers rely on the title attribute.

That being said the xhtml spec states that title is for 'advisory' content. So, I don't really think that it should be relied upon for labeling of controls.

Nevertheless, it is ince that the controls are at least keyboard operable in the plugin now.

clemens.tolboom’s picture

@Everett Zufelt

I'm confused now. As our anchor has a foreground image. Is that content? And do we need it?

What I tried to say in #37 is that the current test branch of jquery-treetable only has an anchor and no foreground image.

And what is the best way to test this functionality?
- Do we have tests for this on d.o?
- Do we have accessibility gates defined already :p
- jquery-treetable maintainer Ludo van den Boom needs to test all browser. How can we help him?
- I only know qunit testing through on of mine dreditor issues.

clemens.tolboom’s picture

What is holding this issue up? It is a release blocker right :p
[Edit] #27 but #26
Patch from #26 still needs a review.

Dave Reid’s picture

I had to cut my losses and roll a 7.x-1.0 release without this issue. It is still considered a big priority to fix, hopefully in a 7.x-1.1 or 7.x-1.2 release.

mgifford’s picture

mgifford’s picture

I just ran into this again (this morning).

@Dave, totally understand your decision of a year ago (exactly) to cut your losses.

What do we need to do to get this into 7.x-1.6?

@clemens.tolboom other than a review of #26, what else would you need.

clemens.tolboom’s picture

@mgifford re-reading from #26 we probably need to

- select a version from https://github.com/ludo/jquery-treetable
- check whether parts of my PR https://github.com/ludo/jquery-treetable/pull/30 has landed? Rereading that PR I see some features are added through other bugs and PRs.
- add the usual external js support like hook_requirements + hook_library?

mgifford’s picture

Prepare 3.0.1 release seems to have addressed it. Tested it here http://ludo.cubicphuse.nl/jquery-treetable/#examples

Looks like we can (only just now) address this from a JS perspective. So right now we're using jQuery treeTable Plugin 2.3.0 I think in Token.

Any reason not to just embed it in the module like it is now?

clemens.tolboom’s picture

@mgifford embedding is not cool :p ... the license is compatible to embed it.

Maybe you're right to embed it. But then the same thing will probably happen and that is patch it without an upstream request.

I personally think it's polite to the upstream maintainer to let people download it by hand or scripts like drush.

mgifford’s picture

I'm fine with it either way.. Just commenting on how it is in the latest release.

It's such a popular module though, would add a lot more work for folks to now have to download it separately, but it's all getting easier with Drush.

Jim Ruby’s picture

wondering if this will ever be accessible?

Jim Ruby’s picture

Issue summary: View changes

Updated issue summary.

Jim Ruby’s picture

Issue summary: View changes

Hi, I need access to the tokens with in drupal using the trigger module, they are not yet accessible with drupal 7.41. Is there another module I can install to make them readable for those needing to use screen readers such as window-eyes, jaws and nvda? This has been a problem for a long time and I have not stayed up to date so maybe there is something hopefully by now working. If not is there a way I can just get all the tokens I can use in a text file for reference?

Thank you

Jim Ruby’s picture

Hello, I am still using drupal 7 and it looks like there is no resolution to view the token tree with a screen reader such as Jaws or Nvda?