interactionsVercel
Autofocus for Speed
SHOULD
SHOULD: Autofocus on desktop when there's a single primary input; rarely on mobile (to avoid layout shift)
On desktop, autofocus single primary inputs; rarely on mobile
Bad
Good
Why it matters
For desktop interfaces with a clear primary action (like a search box), autofocus saves users a click. On mobile, avoid autofocus because the virtual keyboard opening causes jarring layout shifts and may scroll the page unexpectedly.
References