Closed marlowpayne closed 7 years ago
@marlowpayne Okay! I can confirm that this fix works! However, there's another issue that must be addressed: focus must be managed by Pinny (at least by default).
Currently, when using a screen reader (I tested with VoiceOver just now) and you "click" the button that opens the modal, focus remains on the button, which means when the user swipes to see the next visible item, it actually doesn't seem to work... it behaves as if nothing is present. However, if you "tap" on the screen where the modal content exists, the screen reader is then able to see it, and the content can be swiped as expected.
So... if left as it is now, Pinny is still extremely unusable to screen readers. At the very least, I recommend the following be implemented as well:
It may be worth looking at these best practices for the typical expected behaviour of a dialog modal.
This is outside of the scope of this PR, but we may also want to consider requiring that all modals have a "close" button or a set of instructions that explain how to escape the modal (also visually hidden).
For example, on one of our projects, Pinny is used for the main navigation and it has no close button, because the sighted user is expected to click out of the modal, or re-click the open button. Because of this, a screen reader becomes permanently trapped in the main nav. Their only escape is to click a link in the nav, or refresh the page (that's probably bad UX).
Ultimately we want to make pinny as fool proof as possible for implementors, and ensure that end users aren't getting horribly screwed over because someone forgot to add an escape button.
Ah, excellent, I see Cole submitted an issue (#98)! Thanks @cole-sanderson!
I have updated the main PR section with these recent developments:
document.body
. This is to move it by default outside of its Lockup container, which will be aria hidden if the pageContentSelector
option does not exist (default is #x-root
, which doesn't exist in our testing sandbox)@jeffkamo and @cole-sanderson , when you have time could you give this another look?
97 opened against correct base branch for a v2.0.4 release
Opening this PR for visibility and greater discussion about a11y and our plugin architecture
Changes
aria-hidden = true
to its Lockup container, causing it to be unreadable by screenreaders#x-root
(through a newpageContentSelector
option) to determine page content that must be hidden instead of using the Lockup container. It also defaults back to the Lockup container if said element does not exist on page.document.body
instead of the default Lockup container. This ensures that it is kept outside of the Lockup container which becomesaria-hidden
if the newpageContentSelector
element does not exist on page.Outstanding Issues
appendTo
to append itself inside#x-root
or its Lockup container then it'll be aria hiddenHow to Test
Post merge actions
develop
with the legacy Bower components)develop
and a new v3 jQuery release prepared from it