diff --git a/core/modules/media_library/css/media_library.theme.css b/core/modules/media_library/css/media_library.theme.css index d5796bb88b..c2aae837ab 100644 --- a/core/modules/media_library/css/media_library.theme.css +++ b/core/modules/media_library/css/media_library.theme.css @@ -99,7 +99,7 @@ margin: 0 0 1em; } -.media-library-add-form-media { +.media-library-add-form__added-media { outline: none; } @@ -112,10 +112,6 @@ margin: 8px 0 0; } -.media-library-add-form-description { - margin: 0; -} - /* Style the media add oEmbed form. */ .media-library-add-form--oembed .media-library-add-form-input-wrapper { display: flex; diff --git a/core/modules/media_library/src/Form/AddFormBase.php b/core/modules/media_library/src/Form/AddFormBase.php index d5d5006aa0..0c62c26614 100644 --- a/core/modules/media_library/src/Form/AddFormBase.php +++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -136,7 +136,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'container', '#attributes' => [ 'class' => [ - 'media-library-add-form-media', + 'media-library-add-form__added-media', ], 'tabindex' => -1, 'aria-label' => $this->t('Added media items'), @@ -435,7 +435,7 @@ public function updateFormCallback(array &$form, FormStateInterface $form_state) // Update the form and shift focus to the added media items. else { $response->addCommand(new ReplaceCommand("#$wrapper_id", $form)); - $response->addCommand(new InvokeCommand('#media-library-add-form-wrapper .media-library-add-form-media', 'focus')); + $response->addCommand(new InvokeCommand('#media-library-add-form-wrapper .media-library-add-form__added-media', 'focus')); } return $response; diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php index 4a01ef7f62..abd2c39323 100644 --- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php +++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php @@ -828,7 +828,7 @@ public function testWidgetUpload() { $page->attachFileToField('Add files', $this->container->get('file_system')->realpath($png_image->uri)); $assert_session->assertWaitOnAjaxRequest(); // Assert the focus is shifted to the added media items. - $this->assertJsCondition('jQuery("#media-library-add-form-wrapper .media-library-add-form-media").is(":focus")'); + $this->assertJsCondition('jQuery("#media-library-add-form-wrapper .media-library-add-form__added-media").is(":focus")'); // Assert the media item fields are shown and the vertical tabs are no // longer shown. $assert_session->elementExists('css', '.media-library-add-form__fields'); @@ -955,7 +955,7 @@ public function testWidgetOEmbed() { $page->pressButton('Add'); $assert_session->assertWaitOnAjaxRequest(); // Assert the focus is shifted to the added media items. - $this->assertJsCondition('jQuery("#media-library-add-form-wrapper .media-library-add-form-media").is(":focus")'); + $this->assertJsCondition('jQuery("#media-library-add-form-wrapper .media-library-add-form__added-media").is(":focus")'); // Assert the media item fields are shown and the vertical tabs are no // longer shown. $assert_session->elementExists('css', '.media-library-add-form__fields');