Issue Bug Resolved

#108964File reference selector: Focus after closing info dialog is suboptimal

Christian Jung 02/12/26, 14:39 updated 11/04/26, 14:25

Description

When the info dialog opened from within the file reference selector dialog is closed, the keyboard focus jumps to the top of the page instead of returning to the triggering button inside the file reference selector. This is problematic for accessibility and usability.

Steps to Reproduce

  1. Open a backend content element with a file field (e.g. image).
  2. Open the file reference selector dialog.
  3. In the file reference selector, open the info/details dialog for a file via the corresponding button.
  4. Close the info dialog using the “Close” button or ESC.
  5. Observe where the keyboard focus is placed.

Current Behavior

After closing the info dialog, focus is moved to the top of the page or outside of the file reference selector dialog.

Expected Behavior

After closing the info dialog, focus is returned to the button in the file reference selector dialog that was used to open the info dialog.

Impact

  • Keyboard and screen reader users lose their current context.
  • Additional tabbing is required to return to the previous position.
  • Does not follow accessibility best practices for focus management in modal dialogs (e.g. WCAG 2.4.3, 2.4.7).

Recommended Solution

  • Before opening the info dialog, store the currently focused element (trigger button).
  • On closing the info dialog, programmatically move focus back to that stored element (triggerElement.focus()).
  • Ensure all close variants (Close button, ESC, overlay click – if supported) use the same focus-return logic.

Definition of Done

  • After closing the info dialog, focus reliably returns to the triggering button inside the file reference selector dialog.
  • Behavior is consistent across all supported browsers.
  • Manual keyboard testing (open/close info dialog using only the keyboard) shows no unexpected focus jumps.
  • Other backend modal dialogs keep their correct focus behavior (no regressions).

Acceptance Criteria

  • Closing the info dialog via the “Close” button returns focus to the triggering button in the file reference selector dialog.

Reviews 2

Files 1

History 26

  1. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-04T14:25:18+00:00" > 11/04/26, 14:25 </span>

    Applied in changeset commit:e4d5daedeb47fefa5c3171fcd21d5fff7c4f0c0c.