Give focus to an element on startup - or don't?
Submitted by otacke on Thu, 08/03/2017 - 16:07
Forums:
What's the suggested behavior for giving focus to an element on startup?
I added additional key support to Agamotto. You can now use the left key and the right key to jump from one image to another IF you clicked on the images before or jumped to them using the tab key. I don't focus the content or controls on startup since that's the way that Course Presentation and Interactive Video behave, too. However, some people mentioned that this might be rather uncomfortable and counterintuitive.
Is there a general (web accessibility) rule that applies?
thomasmars
Fri, 08/04/2017 - 11:00
Permalink
Guideline 2.1.1 in WCAG 2.0
Guideline 2.1.1 in WCAG 2.0 says
Setting focus on startup of an H5P could introduce some timing issues, which must be avoided. We don't know the context of the H5P that just finished loading so the user could be in the middle of another process.
When we know the action of the user, e.g. changing image to one that is just created, it is perfectly fine, even encouraged to move focus to the new element that was navigated to (if it has an action). We should attempt to make as intuitive navigation as possible. If it makes sense that a H5P spawned from another process should get focus it should be up to the process/function that spawned it to make sure that focus is moved correctly to the H5P on startup.
otacke
Fri, 08/04/2017 - 13:05
Permalink
Alright. Thanks!
Alright. Thanks!