Skip to content

FRM-013 Receiving focus never sends a form, opens a page, a window or a dialog that takes focus, or moves focus on

Level
Rule
Verdict
Requirement
Area
Forms
Status
proposed, version 1.0.0

Rule

When a control receives focus, by Tab, a click or a script, that alone never sends a form, opens a page, a window or a dialog that takes focus, or moves focus to another control. A notice before the control does not change this. Content that appears beside the control and leaves focus in it is allowed.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: Focus shows a hint, a button opens the filters

Page: Find a clinic

Tab into Search clinics. A hint appears and focus stays in the field. Open filters is what opens the dialog.

Don't: Reaching the field opens the filters

Page: Find a clinic

Reaching this field opens the filters.

Opened by focus alone: 0

Tab into Search clinics. The filters open and take focus at once. The line above the field says so, and that does not help: a keyboard user cannot reach the field without setting it off.

Do: Tab passes through the clinics

Page: Clinics near you

Tab through the list. Each clinic gets focus and nothing opens. Enter or a click opens its page.

Don't: Tabbing to a clinic opens it

Page: Clinics near you

Tab or click into the list. The first clinic opens before anything was pressed. Reset brings the list back.

Do: A field nobody should visit is text

Page: Book an appointment

Patient number: P-20931

The patient number is shown as text, so Tab goes straight to Reason for visit.

Don't: A field forwards focus to the next one

Page: Book an appointment

Focus passed on (once, then Reset arms it again): 0

Click Patient number, or Shift+Tab back to it from the next field. Focus is thrown forward as soon as it arrives, so the field cannot be reached.

Why

Keyboard users move through a page by giving each control focus in turn. If arriving on a control sets something off, they cannot pass it: the page sends or changes under them, or focus is thrown somewhere else before they can act. Screen reader users meet the same wall, and anyone who clicks into a field to read it can be sent away by mistake. WCAG 2.2, 3.2.1 On Focus requires that a component receiving focus does not start a change of context. Unlike 3.2.2 On Input, which FRM-012a covers, it has no exception for people who were told beforehand. The Working Group's way to pass is to let changes of context start only when people activate something, such as a link or a button (G107). It lists as a failure a script that takes focus away as soon as a control gets it (F55), which also breaks 2.1.1 Keyboard. That is why 2.1.1 is listed as support. Showing something on focus that leaves focus where it was, such as a tooltip, a hint or a list of suggestions, is a change of content and outside the criterion.

Do

  • In a clinic's booking form, the field Appointment date opens its calendar Popover when the person presses the calendar button next to it or presses Enter or Space on that button. Tab from Appointment date goes on to the calendar button and then to Reason for visit.
  • If the calendar opens when the date field gets focus, keep focus in the field with onOpenAutoFocus={(e) => e.preventDefault()}, and let the down arrow or the calendar button move into it. The calendar stays open while focus is in the field or inside the calendar, and closes when focus goes anywhere else or the person presses Escape, as TXT-002a asks for content shown on focus.
  • The icon next to Reason for visit shows the tooltip "Seen only by your doctor" on focus and on hover, and focus stays on the icon. TXT-002a and TXT-002b set how that tooltip behaves.
  • The combobox Doctor opens its list of names when it gets focus, with focus still in the input. Nothing is chosen until the person picks a name with Enter or a click, and Escape closes the list, as TXT-002a asks.
  • In the DropdownMenu Booking actions, with Move appointment and Print confirmation, arrow keys move the highlight without running anything. Only Enter, Space or a click runs an item. In a Select such as Clinic, Enter only records the value, as FRM-012b asks. Radix behaves this way by default; keep custom onFocus or onPointerMove handlers on items from changing that.
  • Our own advice: show a value the clinic fills in, such as Patient number, as plain text, or as a readOnly input that keeps its place in the tab order. Many screen reader users expect to reach and read such a field, so do not take it out of the tab order just to hide it. Either way focus stays where it lands and needs no forwarding.
  • Every control stays reachable and visibly focused by keyboard, as KBD-001 asks.

Don't

  • Open the calendar Popover from onFocus on Appointment date and let Radix move focus into the calendar, so Tab never gets past the field.
  • Open a Sheet with search filters when the field Search clinics is tabbed into, and let it take focus, so a keyboard user is pulled into the panel each time they reach the field. The same goes for a HoverCard or Popover with the doctor's profile that opens when a doctor's name gets focus and moves focus into it.
  • Call router.push from onFocus on a clinic card in a list, so tabbing through the list opens the first clinic.
  • Send the search Find a clinic when the field is tabbed into, or start the next step when its first field gets focus.
  • Forward focus from one control to the next in an onFocus handler, or call blur() in one so the control drops focus as soon as it gets it. The Working Group lists that second pattern as a failure.
  • Our own advice, beyond what 3.2.1 covers: do not move focus into a menu's panel when the pointer merely hovers its trigger. Hover gives no focus, and a script that adds it surprises keyboard and screen reader users. Inside a menu that is already open, Radix moving focus to the item under the pointer is fine; leave that default alone.
  • Write "Reaching this field opens the filters" above Search clinics and keep the Sheet that takes focus. No notice makes a change on focus acceptable.

Exceptions

  • Activation. A click or a press of Enter or Space on a button or a link activates it, and may open a page or a dialog. That is not focus alone. Where focus goes when a dialog opens and closes is DLG-006, and the order focus follows is LAY-002.
  • Focus set after the person acted. A page or dialog that opens with focus in its first field, because the person pressed something to get there, is outside this rule.
  • The focused item disappears. When the item with focus is removed, focus has to move somewhere. Where focus goes then is DLG-006 when it happens behind a dialog, and STA-002a when a list is emptied; elsewhere this rule does not decide it.
  • One control that grows. A search icon that opens into its own field and puts focus in it is perceived as one control. This rule neither forbids nor recommends it.
  • Changes of value. A combobox that chooses the highlighted option when it loses focus has changed a value, and that is FRM-012a.

Verdict

Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on FRM-013
SourceRoleStancePage
WCAG 2.2LawRequires3.2.1 On Focus
WCAG 2.2LawSupports2.1.1 Keyboard
Material DesignJudge No position
Apple Human Interface GuidelinesJudge SupportsFocus and selection (ipados, macos, tvos, visionos; not ios or watchos; no web guidance)
Carbon Design SystemJudge No position
GOV.UK Design SystemExpert witness No position
Nielsen Norman GroupExpert witness No position

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Forms: 15 rules and 12 guidelines · All rules