Issue #3333418 by nicxvan, smustgrave, quietone: Fix pager h4 for accessibility on Stable9
(cherry picked from commit ecac251678
)
merge-requests/6880/head
parent
11ca3d7e63
commit
ff36302a11
|
@ -165,8 +165,7 @@ class MiniPagerTest extends ViewTestBase {
|
|||
$view->display_handler->setOption('pager', $pager);
|
||||
$view->save();
|
||||
|
||||
// Stark is handled below.
|
||||
// Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418
|
||||
// Stark and Stable9 are handled below.
|
||||
$themes = ['olivero', 'claro', 'starterkit_theme'];
|
||||
$this->container->get('theme_installer')->install($themes);
|
||||
|
||||
|
@ -176,11 +175,14 @@ class MiniPagerTest extends ViewTestBase {
|
|||
$this->assertEquals('h3', $this->assertSession()->elementExists('css', ".pager .visually-hidden")->getTagName());
|
||||
}
|
||||
|
||||
// The core views template uses a different class structure than core themes.
|
||||
$this->container->get('theme_installer')->install(['stark']);
|
||||
$this->config('system.theme')->set('default', 'stark')->save();
|
||||
$this->drupalGet('test_mini_pager');
|
||||
$this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName());
|
||||
// The core views template and Stable9 use a different class structure than other core themes.
|
||||
$themes = ['stark', 'stable9'];
|
||||
$this->container->get('theme_installer')->install($themes);
|
||||
foreach ($themes as $theme) {
|
||||
$this->config('system.theme')->set('default', $theme)->save();
|
||||
$this->drupalGet('test_mini_pager');
|
||||
$this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -400,8 +400,7 @@ class PagerTest extends ViewTestBase {
|
|||
$view->display_handler->setOption('pager', $pager);
|
||||
$view->save();
|
||||
|
||||
// Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418
|
||||
$themes = ['stark', 'olivero', 'claro', 'starterkit_theme'];
|
||||
$themes = ['stark', 'olivero', 'claro', 'starterkit_theme', 'stable9'];
|
||||
$this->container->get('theme_installer')->install($themes);
|
||||
|
||||
foreach ($themes as $theme) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*
|
||||
* Available variables:
|
||||
* - heading_id: Pagination heading ID.
|
||||
* - pagination_heading_level: The heading level to use for the pager.
|
||||
* - items: List of pager items.
|
||||
* The list is keyed by the following elements:
|
||||
* - first: Item for the first page; not present on the first page of results.
|
||||
|
@ -32,7 +33,7 @@
|
|||
#}
|
||||
{% if items %}
|
||||
<nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}">
|
||||
<h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
||||
<{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}>
|
||||
<ul class="pager__items js-pager__items">
|
||||
{# Print first item if we are not on the first page. #}
|
||||
{% if items.first %}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*
|
||||
* Available variables:
|
||||
* - heading_id: Pagination heading ID.
|
||||
* - pagination_heading_level: The heading level to use for the pager.
|
||||
* - items: List of pager items.
|
||||
*
|
||||
* @see template_preprocess_views_mini_pager()
|
||||
|
@ -12,7 +13,7 @@
|
|||
#}
|
||||
{% if items.previous or items.next %}
|
||||
<nav role="navigation" aria-labelledby="{{ heading_id }}">
|
||||
<h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
||||
<{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}>
|
||||
<ul class="js-pager__items">
|
||||
{% if items.previous %}
|
||||
<li>
|
||||
|
|
Loading…
Reference in New Issue