SPACEBAR to move forward through slides.
SHIFT & SPACEBAR to move backwards through slides.
LEFT ARROW & RIGHT ARROW to move through sections.
ESC to see overview and ESC again to exit.
F to enter presentation mode and ESC to exit.
We’re going to explore how two people could interacting with aspects of your web site or web application.
Mary has reduced movement. She uses a head switch (keyboard equivalent) and cannot use a mouse.
Hassan is a person who is blind. He uses a screen reader.
For both Mary and Hassan, focus management helps them understand:
If focus management is poorly managed, it can cause confusion or frustration.
For Hassan, announcing all dynamic changes is also important.
Especially when buttons are used to trigger UI changes.
Let’s look at how some different scenarios could affect Mary and Hassan.
By the way, I will be asking for your answers!
I know it is late. It’s cold. You’d rather be at home in bed watching Netflix.
So, I have some incentives!
The first person who answers correctly in each case wins a mini Mars Bar.
Image that Mary and Hassan have attempted to submit a form, but the form contains errors.
As soon as the submit button is activated:
There are two acceptable answers to this question.
Gimme your answer!
For simple forms, focus can go to the first error within the form.
* Forms with only two questions.
For more complex forms, focus should go to an error message above the form.
* Forms with more than two questions.
Some time ago, I observed Hassan trying to resolve multiple errors in a complex form.
Initially, he was taken to the first invalid field.
When he resolved the error, he hit the B key to take him directly to the submit button.
It took several cycles of this process to for him to realise the form had multiple errors.
If he has been sent to an error message above the form, he would have known the exact number of error messages.
Back to our question... As soon as the submit button is activated:
For the simple form, three things shoulds be immediately annonced if focus goes to the first field that is invalid.
Gimme your answer!
For simple forms:
aria-invalid="true"
).aria-describedby
).And for the more complex form, only one thing should be immediately announced.
Gimme your answer!
Content that informs the user that errors have occurred and possibly provides the number of errors.
Keep in mind, the list of links will not be immediately announced.
Image that Mary and Hassan have successfully completed a process.
A toast notification animates into view from the bottom of the screen for a short period of time before disappearing.
Gimme your answer!
Ideally, toast notifications are for information that does not require user input.
For this reason, focus should not go to the toast notification.
Recently, I observed Mary interacting with a web app.
When the toast popup appeared, focus automatically shifted to the toast notification.
This was disconcerting as she was in the middle of doing a different task, and she was not given any option or warning.
Even worse, she then had to navigate back to her previous location.
Gimme your answers!
If the information is displayed on-screen, it is important enough to be made available to all users.
So, the information could be announced at the next graceful opportunity – using aria-live="polite"
.
Image Mary and Hassan have navigated through a date pickup popover and selected a date.
When they choose a date from the popup:
Gimme your answer!
Focus should return to the input.
Gimme your answer!
When focus returns to the input, the date value should be injected.
So, the following should be announced:
I recently observed Hassan interacting with a date picker.
After choosing a date, focus was sent to the date picker icon rather than the input.
Hassan had no feedback to tell him the date had been successfully stored.
He repeated the process several times until he discovered the date had been correctly injected into the form field.
If focus had been sent to the input, he would have immediately known the process was successful.
Imagine that Mary and Hassan are navigating a vertical accordion.
They decide to select an accordion option to find out more.
When this action is triggered:
Gimme your answer!
Focus should remain on the button that triggered the action.
Gimme your answer!
Remember, we never want Hassan to click something and have silence.
Hassan should be informed that the accordion option has now been expanded.
This can be acheived by dynamically switching aria-expanded="true"
.
<button aria-expanded="false" aria-controls="widget1">
Show widget
</button>
<button aria-expanded="true" aria-controls="widget1">
Hide widget
</button>
As before, I observed Hassan interacting with an accordion.
After triggering an accordion button, there was total silence.
That's when Hassan said:
I hate when I click on something and then hear nothing. I have no idea what just happened.