Skip to content
Snippets Groups Projects
Verified Commit d6a990b8 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder, mgifford:...

Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder, mgifford: aria-current is giving an invalid value
parent 1e830175
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
*/ */
use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\Component\Serialization\Json; use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Crypt;
...@@ -1837,7 +1836,7 @@ function template_preprocess_pager(&$variables) { ...@@ -1837,7 +1836,7 @@ function template_preprocess_pager(&$variables) {
$items['pages'][$i]['attributes'] = new Attribute(); $items['pages'][$i]['attributes'] = new Attribute();
if ($i == $pager_current) { if ($i == $pager_current) {
$variables['current'] = $i; $variables['current'] = $i;
$items['pages'][$i]['attributes']->setAttribute('aria-current', new TranslatableMarkup('Current page')); $items['pages'][$i]['attributes']->setAttribute('aria-current', 'page');
} }
} }
// Add an ellipsis if there are further next pages. // Add an ellipsis if there are further next pages.
......
...@@ -88,7 +88,7 @@ public function testQuantitySet() { ...@@ -88,7 +88,7 @@ public function testQuantitySet() {
/** @var \Drupal\Core\Template\AttributeString $attribute */ /** @var \Drupal\Core\Template\AttributeString $attribute */
$attribute = $variables['items']['pages']['2']['attributes']->offsetGet('aria-current'); $attribute = $variables['items']['pages']['2']['attributes']->offsetGet('aria-current');
$this->assertInstanceOf(AttributeString::class, $attribute); $this->assertInstanceOf(AttributeString::class, $attribute);
$this->assertEquals('Current page', $attribute->value()); $this->assertEquals('page', $attribute->value());
} }
} }
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