Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Some of the Spotlight accessibility improvements implemented in previous versions of Panopoly (see #2229919: Spotlight Accessibility Improvements) have regressed in the latest version of Panopoly.
Specifically:
- When a spotlight is playing (not paused), it is no longer possible to use the tab key to access each of the spotlight pager numbers. Only the active spotlight pager is accessible by tabbing.
- Only when the spotlight is paused are all the spotlight pager numbers accessible from by tabbing.
- When a spotlight item's image or link has tab focus, and then the spotlight moves to the next slide, focus goes immediately back to the top of the page.
Proposed resolution
Un-regress them.
Remaining tasks
The un-regressing.
User interface changes
Better support for tabbing.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#14 | panopoly_widgets-spotlight-no-jqueryui-2528924-14.patch | 21.83 KB | dsnopek |
Comments
Comment #1
dsnopekThanks for reporting this! Marking as Critical as this represents a regression.
Comment #2
dsnopekLooking at the diff from when #2229919: Spotlight Accessibility Improvements was committed to now, there's so many changes to the CSS and Javascript, it's hard to see a smoking gun just from the diff. :-/
Something I just wanted to throw out there quickly: If we could somehow create Behat tests for this functionality, we'd never regress this again! However, testing the spotlight widget via Behat at all is hard, doing it entirely from the keyboard would be even harder. But if we could do it, it'd be brilliant!
Comment #3
dsnopekComment #4
dsnopekI did some testing on older versions of Panopoly: I can't reproduce the regression in Panopoly 1.22, but I can in 1.23. I suspect it was the update of jquery_update that broke it, since that updated jQuery UI from 1.8 to 1.10. :-/
Comment #5
dsnopekReferencing the issue: #2235081: Update jquery_update to version 2.5
Comment #6
cboyden CreditAttribution: cboyden commentedIf the slide number buttons are not programmatically focusable while the slideshow is playing, that should be testable. I don't think Selenium can execute a click on something that's not programmatically focusable. If they are focusable programmatically but not manually then that's the problem, but it'll be harder to test.
Comment #7
dsnopek@cboyden: Sure, we could try that. However, I'd prefer that the tests not be so specifically targeted at this regression, because the next regression will probably be different. It'd be best if test could walk through basically using the spotlight via the keyboard, such that anything that broke the normal flow would be caught!
Comment #8
dsnopekSo... The Spotlight is implemented using jQuery UI tabs: the slide numbers are the tabs themselves, and then the image is the content of the tab. #1 from the issue summary appears to be by design:
jQuery UI wants you to use the right/left arrow keys to change which tab is selected. That kinda makes sense for normal tabs, but is totally a WTF for our spotlight.
You can try a demo of normal jQuery 1.10 tabs here:
http://api.jqueryui.com/1.10/tabs/#entry-examples
So, this appears to be a bug somewhere. I'm honestly not sure why it even works! I would have expected that #1 would still have blocked this, but the tabs (the
<li>
) can't be focused, the links inside of them can. So, when the spotlight is paused, you get two tab stops on the selected slide number, and only one on all the rest.I haven't been able to pin this point down to anything in the jQuery UI code or reproduce on vanilla jQuery UI, but I suspect this is just an oversight. I don't think they expect the tab to change without someone clicking or keyboarding their way to the tab (which would correct the focus).
Anyway, I'm personally starting to feel like the root of the problem here is just that we're trying to abuse jQuery UI tabs to implement this! I really don't see how to correct jQuery UI's behavior to match our expectations. :-/ Maybe the solution here is switching to some other plugin to this, like cycle2? Or some pure custom code?
Some more researching / thinking / soul searching will be required to make a decision on that...
Comment #9
cboyden CreditAttribution: cboyden commented@dsnopek - For the eventual test that will verify it's working again, Behat provides a keypress step for form fields:
Given I press the :char key in the :field field
But not a generic keypress step. Probably the thing to do would be write three custom steps using Selenium functions. One step would programmatically focus an element by ID. The next would execute a keypress a specified number of times. And the third would check which element had focus. So the test could focus on a known element (to avoid tabbing through the whole page), then tab a specified number of times, then check that it was focused on the correct element. And then if there's an element of keyboard interactivity to check, the test could execute an Enter or Space keypress and verify the results.
Comment #10
dsnopekHere's the first pass at a patch that doesn't use jQuery UI. It seems to work fine if there is only one spotlight on the page, but bad things happen if there two. I haven't figured that out yet and haven't done a review of the accessibility yet, but just wanted to post the in-progress patch.
Comment #11
dsnopekOk, here's a patch that's actually ready for review!
I fixed the issue with multiple Spotlight widgets on the same page, fixed a bug with the "Mini pager" style, and moved all the CSS for the spotlight into it's own CSS file (in a similar vein to other similar Spotlight refactors: #2526330: Split spotlight JS into it's own file). The patch was already changing every line of the Spotlight CSS, so I'm not really worried about scope creep. :-)
Also, I did some testing with the 3rd problem in the issue summary:
And this was a problem even on Panopoly 1.21, which is before the jQuery UI update. So, this part I don't think is a regression. We should still totally solve it! But, if a solution is going to take a while, in order to fix this critical quickly, we might have to spin that out into a follow-up issue.
Comment #12
cboyden CreditAttribution: cboyden commentedThis is happening for me on Chrome, but not Firefox.
Comment #13
cboyden CreditAttribution: cboyden commentedThanks for the patch! I and a screenreader-using colleague tested it. As far as accessibility goes, it is equivalent to the version before the regressions introduced by the new jQuery UI version.
When I applied the patch I had to do a feature revert of panopoly_widgets.field_instance and a cache clear. Without them, the image did not display and there were a bunch of PHP notices. So this needs an update hook. Once that's in place, this should be good to go.
Comment #14
dsnopek@cboyden: Thanks for testing!
The Feature being overridden turned out to have nothing to do with this issue - I fixed that on this issue #2532908: Panopoly Widgets overridden after upgrade to -dev
Here's a new patch (against latest -dev, which has changed per #2532908) that adds a
hook_update_N()
and fixes the issue where the pager would be positioned incorrectly under some themes.I tested this by:
drush updb -y
It worked in my testing!
Comment #15
dsnopekOh, and I also created some follow-up issues so we can get this one committed as fast as possible:
#2532886: When slide in Spotlight has keyboard focus, all focus is lost when the slide changes (under Chrome)
#2532884: Audit and simplify the panopoly-widgets-spotlight.css
Comment #16
cboyden CreditAttribution: cboyden commentedThis all works as advertised. I may file some more accessibility enhancements later, but this patch restores the previous level of function.
Comment #17
dsnopekJust to be safe, here's a Travis-CI build with this patch:
https://travis-ci.org/panopoly/panopoly/builds/70972670
I actually just realized that we do have some minimal Spotlight tests, so this will at least see if anything explodes. :-)
Comment #18
dsnopekThe tests have passed! It would have been great to get confirmation from @ultimike that this fixed it for him, but since this is Critical, I'm going to commit right away. Please feel free to test the latest -dev and report back here if there are problems!
Comment #20
ultimikeWow - this all happened very quickly - sorry I haven't checked in a day or two.
I'm booked for the rest of the day, but I'll make it a priority to test this tomorrow.
Thank you!
-mike
Comment #21
ultimikeI had a test to play with this a bunch today, so far, it looks great!
I uploaded a patch to #2532886: When slide in Spotlight has keyboard focus, all focus is lost when the slide changes (under Chrome) for one of the "focus" issues.
thanks,
-mike
Comment #22
dsnopek@ultimike: Awesome! Thanks for testing. :-)