Setting Focus on Page Load

Setting focus (typically onto a text input) on page load has advantages and disadvantages for users.

You must not set focus on page load without an exception.

Advantages

  • mouse users are saved one click

  • sighted keyboard users are saved a few tabs

These advantages are only beneficial if the user understands that focus has been placed in the input. If not clear, the user may navigate away from the input and then have to navigate back to it resulting in a loss of whatever efficiency may have been gained by auto-setting focus.

Disadvantages

  • creates an inconsistency in navigation within the site/subsite since most pages do not set focus on page load

  • sighted keyboard users that rely on keyboard shortcuts for navigation (Page Down/Spacebar, End, etc.) will need to leave the context of the text input in order to navigate

  • screen reader users that rely on shortcuts for navigation will either need to leave the context of the input or exit "forms" mode in order to navigate

Exceptions

Specific MIND Patterns, such as Page Notice, may direct you to set focus on page load.

If not directed by a MIND Pattern to set focus on page load, the following conditions must be met by a page to be eligible for an exception:

  • Page's title element must describe the primary purpose of the page

  • Setting focus on load must not interrupt the screen reader announcing the page's title

  • There must not be content in the main landmark before the auto-focused input

  • The input must be either:

    • the primary purpose of the page or

    • the first step in the process that is the primary purpose of the page