Skip to content

Add error recovery and focus trap to thread loading in forum sidebar - #1707

Merged
gwprice merged 2 commits into
masterfrom
gprice/forum-thread-list-focus-trap
Nov 20, 2013
Merged

Add error recovery and focus trap to thread loading in forum sidebar#1707
gwprice merged 2 commits into
masterfrom
gprice/forum-thread-list-focus-trap

Conversation

@gwprice

@gwprice gwprice commented Nov 19, 2013

Copy link
Copy Markdown

Greg Price added 2 commits November 19, 2013 10:06
When a user attempts to load more threads in the forum navigation
sidebar, reset the state of the world so the user can retry, and alert
the user appropriately.
For accessibility purposes, it is bad to allow a user to initiate
loading of additional threads in the navigation sidebar and then shift
focus away from the sidebar, only to have focus snap back when the
additional threads are loaded. Now, we trap focus on the loading element
as recommended by our accessibility consultant.

JIRA: FOR-238
@jimabramson

Copy link
Copy Markdown

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One note about this approach is that when testing on ChromeVox, a user who is routed to this FocusTrap in the case of a 500 is taken to the button which reads OK, but must then manually navigate out to the alert message and header to understand the cause for the error. Could we .find the entire modal or header item instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's odd; the non-specific alert dialog reads the whole error message, but this one does not. I'll try to figure out why.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Also, you cannot focus on a non-interactive element, so the answer to the question you posed is no.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

JAWS doesn't read either alert. According to http://www.w3.org/TR/wai-aria/roles#alertdialog, "authors SHOULD set focus to an active element within the alert dialog, such as a form edit field or an OK button." Also, "Authors SHOULD use aria-describedby on an alertdialog to point to the alert message element in the dialog," which we are doing. I don't know why the alert is not being read. This represents a step in the right direction, so I think we should go ahead with this change and consult with an expert for advice on improving the experience.

@marcotuts

Copy link
Copy Markdown
Contributor

👍

gwprice pushed a commit that referenced this pull request Nov 20, 2013
Add error recovery and focus trap to thread loading in forum sidebar
@gwprice
gwprice merged commit 21169cb into master Nov 20, 2013
@gwprice
gwprice deleted the gprice/forum-thread-list-focus-trap branch November 20, 2013 18:19
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.

3 participants