mobify / pinny

A mobile-first content fly-in UI plugin
MIT License
23 stars 4 forks source link

Fix a11y issue where all pinnies are inaccessible to screenreaders #99

Closed marlowpayne closed 7 years ago

marlowpayne commented 8 years ago

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

jeffkamo commented 8 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.

jeffkamo commented 8 years ago

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.

jeffkamo commented 8 years ago

Ah, excellent, I see Cole submitted an issue (#98)! Thanks @cole-sanderson!

marlowpayne commented 8 years ago

I have updated the main PR section with these recent developments:

@jeffkamo and @cole-sanderson , when you have time could you give this another look?