Skip to content
Snippets Groups Projects
Verified Commit 7bd749f1 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
parent 564c312e
No related branches found
No related tags found
No related merge requests found
......@@ -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')
);
});
......
......@@ -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.
......
......@@ -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' => [],
......
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment