When any part of a page receives focus, it shouldn't initiate a "change of context". "Change of context" in this sense means "major changes in the content of the Web page that, if made without user awareness, can disorient users who are not able to view the entire page simultaneously". This could include changes of user agent, of viewport (usually the active window), of focus, or of content that changes the meaning of the page.
Examples of violations would be a page that immediately and without user action opens a new window and shifts the focus to that window on page load, or a script that moves the focus to an different element once a certain element received focus.
3.2.1 On Focus: When any component receives focus, it does not initiate a change of context.
How to fix:
Use user activation (an action) rather than user focus (a state) as the trigger for a change of context. In other words, the user has to explicitly choose the change of context, rather than having it happen automatically as soon as an element was selected. For example:
- The page should pop up a new window only when a user follows a link via a click or key press, rather than have the popup occur when the link is focused upon.
- Use a submit button to move onto the next stage of a process, rather than having it occur when the user tabs to a "Done" button or link.