diff --git a/core/modules/media_library/css/media_library.theme.css b/core/modules/media_library/css/media_library.theme.css index 92c52d69e1..197c3f0bd3 100644 --- a/core/modules/media_library/css/media_library.theme.css +++ b/core/modules/media_library/css/media_library.theme.css @@ -92,6 +92,12 @@ margin: 0 0 1em; } +/** + * Remove outline from added media container. + * + * The added media container receives focus after adding new media, but doesn't + * need the outline. + */ .media-library-add-form__added-media { outline: none; } diff --git a/core/modules/media_library/src/Form/AddFormBase.php b/core/modules/media_library/src/Form/AddFormBase.php index d5ec0f16f1..7391879582 100644 --- a/core/modules/media_library/src/Form/AddFormBase.php +++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -146,6 +146,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'class' => [ 'media-library-add-form__added-media', ], + // Add the tabindex '-1' to allow the focus to be shifted to the + // container. 'tabindex' => -1, 'aria-label' => $this->t('Added media items'), ],