Issue Bug Resolved

#109864Modal dialogs do not submit on Enter key

Wolfgang Klinger 05/22/26, 16:11 updated 10/05/26, 09:52

Description

The “Refresh Login” modal that appears after a session expires cannot be submitted with the Enter key. The password field is correctly autofocused on open, but pressing Enter does nothing — the user has to Tab
or click the “Login” button.

This was previously reported as #97746 and fixed in 11.5 / main via edada8a0cd2a8e13265082c19154d37abb96c432 (“Enable login refresh form submit via ENTER key”), which marked the Login button as type=“submit“
and bound it to the form via the form=“beLoginRefresh” attribute.

The fix regressed in c75033adde52630e2de8f369822dfee03edeae80 (#101816, v12.4): “Use typo3/backend/modal in login-refresh". The migration from the jQuery / Bootstrap modal API to the new typo3/backend/modal
API dropped the type=“submit” and form=“beLoginRefresh” attributes and replaced the form submission with a manual `trigger: () => modal.querySelector(‘form’).requestSubmit()` callback. The button is no longer
the form’s default button, so HTML5 implicit submission via Enter cannot reach it.

In addition, the Modal component’s typo3-modal-shown handler unconditionally moves focus to the configured active footer button, which overrides the native `

.showModal()` autofocus for content fields
with the autofocus attribute. The same fragile pattern (manual requestSubmit() from a trigger callback instead of a form-owned submit button) also exists in:
  • scheduler-add-group dialog
  • online-media dialog
  • file-list rename dialog
  • etc.

Those work today only because their forms have a single text-blocking field, so HTML5’s “single field” implicit submission fallback kicks in.

Proposed fix

  1. Modal component: in the typo3-modal-shown handler, respect descendant [autofocus] in the modal body — only fall back to focusing the active footer button when no body element claims focus.
  2. Login Refresh dialog: mark the Login button active:true and bind it to the form via form:‘beLoginRefresh’, drop the manual requestSubmit() in the click trigger.
  3. Apply the same form:’<id>‘ pattern to the scheduler-add-group, online-media, and file-list-rename and other dialogs for consistency.</id>

Related: #97746, #101816

Reviews 2

History 49

  1. Wolfgang Klinger commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-05T07:45:10+00:00" > 10/05/26, 07:45 </span>

    Applied in changeset commit:098b878f8f2da2dda97ed3bb64fb95fdb8e26d67.