Dialog focus is returned to dialog instead of first tabbable element on dialog AJAX update

Created on 30 October 2023, 8 months ago
Updated 5 December 2023, 7 months ago

Problem/Motivation

If a modal dialog is replaced with a new modal dialog, the dialog is not closed and opened but the contents are simply replaced. In this case, the focus is returned to the dialog itself, instead of the first element within the dialog. This can be tested manually using the multistep dialogs in โœจ Use modals in field creation and field edit flow Needs work .

Steps to reproduce

Create a new field using the multistep dialog in โœจ Use modals in field creation and field edit flow Needs work

  1. Navigate to the manage fields page (eg. /admin/structure/types/manage/article/fields)
  2. Open the multistep field creation dialog using the Create a new field button.
  3. Click on any of the field type cards to move to the next step.
  4. Go back to the previous form using the Change field type button.
  5. Observe that the focus is returned to the dialog instead of the first element within the dialog.

Proposed resolution

Move focus to the first tabbable element in the dialog when the content is replaced.
Before: Focus is returned to the dialog

After: Focus is moved to the first element within the dialog.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Fixed

Version

10.2 โœจ

Component
Javascriptย  โ†’

Last updated about 1 hour ago

  • Maintained by
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @justafish
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance @nod_
Created by

๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024