Skip to content
Snippets Groups Projects
Unverified Commit 4a7d1dde authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3087405 by andrewmacpherson, bnjmnm, phenaproxima, rainbreaw, annagaz,...

Issue #3087405 by andrewmacpherson, bnjmnm, phenaproxima, rainbreaw, annagaz, cboyden: For screenreader users using the media and media library UI, the words "remove" and "removed" sound too similar

(cherry picked from commit a2f5778f)
parent c23eecc8
No related branches found
No related tags found
9 merge requests!1445Issue #2920039: Views' User Name exposed group filter validation,!1298Issue #3240993: Let layout builder render inline block translations,!774Issue #3174569: Example node template file name is incorrect,!497Issue #2463967: Use .user.ini file for PHP settings,!433Resolve #3163663 "Too many open files",!233Resolve #2693787 "Taxonomy term name",!133Resolve #2666286 "Clean up menuui",!112Resolve #3187004 "Drupaldatetime serialization issue",!53Resolve #3181870: Correct typo "the the" in "core/classList" deprecation message.
...@@ -667,7 +667,9 @@ public static function updateWidget(array $form, FormStateInterface $form_state) ...@@ -667,7 +667,9 @@ public static function updateWidget(array $form, FormStateInterface $form_state)
// Announce the updated content to screen readers. // Announce the updated content to screen readers.
if ($is_remove_button) { if ($is_remove_button) {
$announcement = t('Removed @label.', ['@label' => Media::load($field_state['removed_item_id'])->label()]); $announcement = t('@label has been removed.', [
'@label' => Media::load($field_state['removed_item_id'])->label(),
]);
} }
else { else {
$new_items = count(static::getNewMediaItems($element, $form_state)); $new_items = count(static::getNewMediaItems($element, $form_state));
......
...@@ -201,7 +201,7 @@ public function testWidget() { ...@@ -201,7 +201,7 @@ public function testWidget() {
$button = $assert_session->buttonExists('Remove', $wrapper); $button = $assert_session->buttonExists('Remove', $wrapper);
$this->assertSame('Remove Dog', $button->getAttribute('aria-label')); $this->assertSame('Remove Dog', $button->getAttribute('aria-label'));
$button->press(); $button->press();
$this->waitForText('Removed Dog.'); $this->waitForText('Dog has been removed.');
// Assert the focus is set back on the open button of the media field. // Assert the focus is set back on the open button of the media field.
$this->assertJsCondition('jQuery("#field_twin_media-media-library-wrapper .js-media-library-open-button").is(":focus")'); $this->assertJsCondition('jQuery("#field_twin_media-media-library-wrapper .js-media-library-open-button").is(":focus")');
...@@ -218,9 +218,9 @@ public function testWidget() { ...@@ -218,9 +218,9 @@ public function testWidget() {
$assert_session->hiddenFieldValueEquals('field_twin_media[selection][0][target_id]', 4); $assert_session->hiddenFieldValueEquals('field_twin_media[selection][0][target_id]', 4);
$assert_session->hiddenFieldValueEquals('field_twin_media[selection][1][target_id]', 4); $assert_session->hiddenFieldValueEquals('field_twin_media[selection][1][target_id]', 4);
$wrapper->pressButton('Remove'); $wrapper->pressButton('Remove');
$this->waitForText('Removed Dog.'); $this->waitForText('Dog has been removed.');
$wrapper->pressButton('Remove'); $wrapper->pressButton('Remove');
$this->waitForText('Removed Dog.'); $this->waitForText('Dog has been removed.');
$result = $wrapper->waitFor(10, function ($wrapper) { $result = $wrapper->waitFor(10, function ($wrapper) {
/** @var \Behat\Mink\Element\NodeElement $wrapper */ /** @var \Behat\Mink\Element\NodeElement $wrapper */
return $wrapper->findButton('Remove') == NULL; return $wrapper->findButton('Remove') == NULL;
...@@ -302,7 +302,7 @@ public function testWidget() { ...@@ -302,7 +302,7 @@ public function testWidget() {
$button = $assert_session->buttonExists('Remove', $wrapper); $button = $assert_session->buttonExists('Remove', $wrapper);
$this->assertSame('Remove Cat', $button->getAttribute('aria-label')); $this->assertSame('Remove Cat', $button->getAttribute('aria-label'));
$button->press(); $button->press();
$this->waitForText('Removed Cat.'); $this->waitForText('Cat has been removed.');
// Assert the focus is set to the wrapper of the other selected item. // Assert the focus is set to the wrapper of the other selected item.
$this->assertJsCondition('jQuery("#field_twin_media-media-library-wrapper [data-media-library-item-delta]").is(":focus")'); $this->assertJsCondition('jQuery("#field_twin_media-media-library-wrapper [data-media-library-item-delta]").is(":focus")');
$assert_session->elementTextNotContains('css', '#field_twin_media-media-library-wrapper', 'Cat'); $assert_session->elementTextNotContains('css', '#field_twin_media-media-library-wrapper', 'Cat');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment