Issue Bug Closed

#108875Focus not moved to overlay when opening dialog after clearing a required field

Christian Jung 02/05/26, 15:29 updated 11/11/26, 10:36

Description

When editing a page in the backend and clearing a required field, an overlay (e.g. validation or information dialog) is displayed. When the overlay opens, the keyboard focus is not moved to the overlay or the first interactive element inside it, but stays on an element in the background. This leads to an incorrect focus order and limited usability for keyboard and screen reader users.

Steps to Reproduce

  • Log in to the TYPO3 backend.
  • Edit a page in the “Page” / “Web > Page” module (page properties or similar).
  • Clear a required field (e.g. page title or another mandatory field).
  • Trigger an action that opens the overlay (e.g. Save, Close or similar action that shows a dialog).
  • Observe: After the overlay opens, the keyboard focus remains on a background element instead of moving into the overlay.

Impact

  • Keyboard users need multiple Tab presses to reach the overlay or may not reach it at all.
  • Screen readers do not immediately announce the overlay content.
  • Violates accessible focus handling (e.g. WCAG 2.1 – focus order).

Recommended Solution

  • When opening the overlay, programmatically move focus to the overlay or to the first meaningful interactive element inside it (e.g. first button or form field).
  • Implement a focus trap so that, while the overlay is open, only elements inside the overlay can receive focus.
  • When closing the overlay, restore focus to the triggering element (e.g. the original button or affected field).
  • Ensure correct ARIA roles and attributes on the overlay (e.g. role=“dialog”, aria-modal=“true”).

Definition of Done

  • On opening the overlay, keyboard focus automatically moves into the overlay to the first meaningful interactive element.
  • While the overlay is open, background elements cannot be focused via keyboard.
  • After closing the overlay, focus returns to the element that triggered the overlay.
  • Behaviour tested in major browsers (at least current versions of Chrome, Firefox, Edge).
  • Manual tests with keyboard-only navigation and a screen reader (e.g. NVDA or VoiceOver) show expected, understandable behaviour.

References

  • WCAG 2.1 – 2.4.3 Focus Order
  • WAI-ARIA Authoring Practices – Dialog (Modal) Pattern

Acceptance Criteria

  • AC1: Open the overlay from a form with a cleared required field → immediately after opening, focus is on an interactive element inside the overlay.
  • AC2: With the overlay open, Tab/Shift+Tab navigation is restricted to elements inside the overlay; background page elements cannot be focused.
  • AC3: After closing the overlay, focus is restored to the original triggering element (e.g. “Save” button or the form field).
  • AC4: A screen reader announces the dialog heading and then the dialog content immediately after the overlay opens.

Reviews 1

Files 1

History 29

  1. Benni Mack commented and changed status Under Review Closed <span data-processor="relativetime" data-value="2026-11-11T10:36:50+00:00" > 11/11/26, 10:36 </span>

    duplicate of #108965 (resolved by Gerrit 96969)