Review 14.3 Merged

97340[BUGFIX] Return the focus to the element that opened a modal

Oli Bartsch CR +2 V +2 Normal +100 −8 updated 11/04/26, 15:01

Commit message

A modal is rendered in the top document, while the button that opens
it usually sits in the module frame. When the dialog closes, the
browser can only return the focus to the frame, not to the button in
it, so keyboard users lost their place after every modal, e.g. after
adding or configuring a dashboard.

The modal now remembers the focused element when it is created,
following the focus into same-origin frames, and focuses it again
after closing if it is still in the document. This also covers a
modal opened from a frame inside another modal, e.g. the file info
dialog opened from the file selector. Listeners that move the
focus elsewhere on "typo3-modal-hidden" still win, as they run later.
The dashboard's own workaround for removing a widget is not needed
anymore.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 2

Files 5

Review log 34

  1. Oli Bartsch uploaded patch set 1 11/04/26, 14:19

  2. core-ci voted on patch set 1 V +1 11/04/26, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113281

  3. Oli Bartsch voted on patch set 1 CR +2 V +2 11/04/26, 15:01

  4. Oli Bartsch merged patch set 2 11/04/26, 15:01