Verified Commit 5b39ed89 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #2805219 by yash.rode, andrewmacpherson, seanB, narendraR: Some dialogs...

Issue #2805219 by yash.rode, andrewmacpherson, seanB, narendraR: Some dialogs do not receive focus when opened

(cherry picked from commit 7bd749f1)
parent 328369e7
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1085,7 +1085,9 @@
    const focusChanged = Object.keys(response || {}).some((key) => {
      const { command, method } = response[key];
      return (
        command === 'focusFirst' || (command === 'invoke' && method === 'focus')
        command === 'focusFirst' ||
        command === 'openDialog' ||
        (command === 'invoke' && method === 'focus')
      );
    });

+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ public function testUserFieldBlock() {
    $this->clickLink('Place block');
    $assert_session->assertWaitOnAjaxRequest();

    // Ensure that focus is on the first focusable element on modal.
    $this->assertJsCondition('document.activeElement === document.getElementsByClassName("block-filter-text")[0]');

    // Ensure that fields without any formatters are not available.
    $assert_session->pageTextNotContains('Password');
    // Ensure that non-display-configurable fields are not available.
+0 −3
Original line number Diff line number Diff line
@@ -527,9 +527,6 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
          'type' => 'throbber',
          'message' => $this->t('Opening media library.'),
        ],
        // The AJAX system automatically moves focus to the first tabbable
        // element of the modal, so we need to disable refocus on the button.
        'disable-refocus' => TRUE,
      ],
      // Allow the media library to be opened even if there are form errors.
      '#limit_validation_errors' => [],
+0 −3
Original line number Diff line number Diff line
@@ -104,9 +104,6 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
        'query' => $query,
      ],
      'callback' => [static::class, 'updateWidget'],
      // The AJAX system automatically moves focus to the first tabbable
      // element of the modal, so we need to disable refocus on the button.
      'disable-refocus' => TRUE,
    ];

    $form['actions']['submit']['#value'] = $this->t('Insert selected');