Autofocus fits a single, obvious primary field
Aliases: find bar focus · login autofocus · one-field view
What it is
When this screen’s job is to fill this one slot—a find bar, an unlock password, a popped “go to line”—dropping focus there saves a click and does not steal another story. Single-primary-field autofocus is the justified exception to load focus: one field, and the window title already states the purpose. The issue is when load focus helps rather than steals, not the general case of a screen reader’s order being interrupted, and not the hand-off when a dialog opens and closes.
Why it happens
Saving a click holds only if people entered the screen in order to type in that slot, with no parallel primary action and no instructions that must be heard first. Find, lock screen, and a quick jump qualify. A multi-field form, a dashboard whose search is only chrome in the top bar, a settings row that is not this visit’s task—autofocus then imposes “primary” on a slot that is not. The test is: take autofocus away, do almost everyone’s first acts still click this one slot? If first acts scatter, it is not a single primary.
Where it stops holding
On mobile the keyboard covers half the screen; even with one field, autofocus may raise the keyboard while the person still wanted to scan a result list. “Single” still holds; “obviously type at once” does not. An international keyboard or IME may arrive with the previous page’s input mode still on when autofocus fires. A one-field widget embedded in a third-party page will steal focus from the host; uniqueness holds only inside the widget.
Applying it
- Autofocus only when the view’s task can be said in one sentence as “type into this one slot.”
- Do not treat the first item or the top-bar search as primary on multi-field pages, long-lead pages, or dashboards.
- On mobile, if the keyboard would hide content still needed for a scan, leave focus for the first tap.
- Verify by asking five first-time visitors what they would do first. If all five point at the same slot, autofocus matches. If someone reads first, taps something else, or wants the keyboard down, a single primary does not hold.
Related
- Within the group: E2.22.1 Focusing on load interrupts a screen reader’s document order · E2.22.3 A dialog should take focus on open and return it on close · E2.22.4 A focus jump nobody asked for interrupts typing in progress
- Adjacent: E2.10 Search fields · E2.09 Password fields
- Search terms:
single-primary-field autofocus·find bar focus·autofocus exception