Review main Merged

94671[BUGFIX] Centralize focus handling in the backend wizard

Benjamin Kott CR +2 V +2 Normal +132 −17 updated 07/17/26, 07:50

Commit message

typo3-backend-wizard never moved focus into a step on its own, leaving
it up to individual steps. As a result keyboard users landed on
inconsistent elements after navigating between steps, and steps that
load their content asynchronously received no focus at all.

Handle focus in the wizard itself. On every step change focus is
directed at the selected radio, otherwise the first form control and
otherwise the primary action button. Steps that build their content
asynchronously re-render the wizard once their data settles, so the
attempt is repeated on each update until a target appears; steps no
longer need to wire up focus themselves. Enter pressed inside a bare
input now advances the wizard, emulating a form submit.

The ad-hoc focus workaround in the form wizard's settings step is
removed as it is now handled centrally.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Georg Ringer +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Georg Ringer +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 8

Review log 1318

  1. Benjamin Kott uploaded patch set 1 07/03/26, 13:13

  2. core-ci voted on patch set 1 V +1 07/03/26, 13:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104287

  3. Benjamin Kott uploaded patch set 2 V +1 07/03/26, 13:49

  4. core-ci voted on patch set 2 V +1 07/03/26, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104292

  5. Benjamin Kott uploaded patch set 3 07/03/26, 14:30

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  6. core-ci voted on patch set 3 V +1 07/03/26, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104302

  7. Benjamin Kott uploaded patch set 4 V +1 07/07/26, 12:01

  8. core-ci voted on patch set 4 V +1 07/07/26, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104461

  9. Andreas Kienast commented on patch set 4 07/09/26, 10:05

    wizard.ts:252

    I'd prefer to wrap this major chunk into a separate condition. It makes clear it needs `content` and thus allows to drop a lot of null-coalesce chaining. ```suggestion if (content) { if (content.contains(this.ownerDocument.activeElement)) { return true; } // Respect an explicit autofocus declared by the step. const explicit = content.querySelector<HTMLElement>('[autofocus]'); if (explicit) { explicit.focus(); return true; } const target = content.querySelector<HTMLElement>('input[type="radio"]:checked') ?? content.querySelector<HTMLElement>('input:not([type="hidden"]):not([type="radio"]):not([disabled]), select:not([disabled]), textarea:not([disabled])'); if (target) { // autofocus makes an opening modal <dialog> pick this over the close // button; focus() covers later step transitions. target.setAttribute('autofocus', ''); target.focus(); return true; } } ```
  10. Benjamin Franzke commented on patch set 4 07/10/26, 07:05

    wizard.ts:244

    I think this can be replaced by `content?.querySelector(':read-write')`
  11. Benjamin Kott uploaded patch set 5 V +1 07/10/26, 09:47

  12. Benjamin Kott commented on patch set 5 07/10/26, 09:48

    wizard.ts:252 Reply

    Done
  13. core-ci voted on patch set 5 V +1 07/10/26, 09:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104599

  14. Georg Ringer voted on patch set 5 CR +1 V +1 07/14/26, 21:12

  15. Benjamin Franzke commented on patch set 5 07/16/26, 11:00

    wizard.ts:244 Reply

    fine by me as-is, as :read-write does not include select.
  16. Andreas Kienast voted on patch set 5 CR +1 V +1 07/17/26, 05:04

  17. Benjamin Kott voted on patch set 5 CR +2 V +2 07/17/26, 07:50

  18. Benjamin Kott merged patch set 6 07/17/26, 07:50