Problem/Motivation

There are some use cases where you don't want that Ajax.dialog autofocuses on the dialog.
My use case is because of: layoutbuilder_extras_live_update
I am updating the Layout in the background. In this use case I don't want that Dialog gives focus to the dialog again.

I've added a setting on drupalSettings to make this configurable.

if (
          settings.dialog.autoFocus === 'undefined' ||
          settings.dialog.autoFocus !== false
        ) {
          $dialog.dialog('widget').trigger('focus');
        }

Proposed resolution

Add a setting to make this configurable.

Remaining tasks

Review

CommentFileSizeAuthor
#5 3344259-nr-bot.txt90 bytesneeds-review-queue-bot

Issue fork drupal-3344259

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Mschudders created an issue. See original summary.

cilefen’s picture

Version: 9.5.x-dev » 10.1.x-dev
mschudders’s picture

git fetch drupal-3344259
ssh: connect to host git.drupal.org port 22: Operation timed out
fatal: Could not read from remote repository.

bleh

Trying again next week

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mschudders’s picture

new branch created against 10.1.x

Issue with the last line "(jQuery, Drupal)..." isn't there.

Let's test.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tim-diels made their first commit to this issue’s fork.

tim-diels’s picture

Status: Needs work » Needs review

Rebased to be up-to-date.

smustgrave’s picture

There may be an accessibility issue with changing this.

smustgrave’s picture

Status: Needs review » Needs work

So this may be an accessibility regression according to docs like https://usability.yale.edu/web-accessibility/articles/focus-keyboard-ope... when a modal or dialog open focus needs to move into the modal.

tim-diels’s picture

Opened MR against 11.x to move forward.
What are the exact issues and are there any suggestions how to tackle these?

Gauravvvv made their first commit to this issue’s fork.

gauravvvv’s picture

Issue summary: View changes
tim-diels’s picture

Hi @Gauravvvv, what did you change? Could you explain what you did?

gauravvvv’s picture

Hi @tim-diels, There were some unwanted whitespaces in the core/misc/dialog/dialog.ajax.jsfile, which leads to Custom commands failure. I fixed them.

mschudders’s picture

Status: Needs work » Closed (outdated)

this is not necessary anymore as of 10.2.x

There is already a fix inside of the JS. Nicely done.