Verified Commit 3a54db4a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3444512 by neclimdul, alexpott, smustgrave: Pager current page announced twice

parent d349f1d6
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
          {% endif %}
          <a href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title') }}>
            <span class="visually-hidden">
              {{ current == key ? 'Current page'|t : 'Page'|t }}
              {{ 'Page'|t }}
            </span>
            {{- key -}}
          </a>
+4 −1
Original line number Diff line number Diff line
@@ -373,7 +373,10 @@ public function testNormalPager() {
    $view->display_handler->setOption('pager', $pager);
    $view->save();
    $this->drupalGet('test_pager_full', ['query' => ['page' => 2]]);
    $this->assertEquals('Current page 3', $this->assertSession()->elementExists('css', '.pager__items li.is-active')->getText());
    $this->assertEquals('Page 3', $this->assertSession()->elementExists('css', '.pager__items li.is-active')->getText());
    $link = $this->assertSession()->elementExists('css', '.pager__items li.is-active a');
    $this->assertSame('page', $link->getAttribute('aria-current'));
    $this->assertSame('Current page', $link->getAttribute('title'));
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@
          {% endif %}
          <a href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title').addClass(['pager__link', current == key ? ' is-active']) }}>
            <span class="visually-hidden">
              {{ current == key ? 'Current page'|t : 'Page'|t }}
              {{ 'Page'|t }}
            </span>
            {{ key }}
          </a>
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@
              <a href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title').addClass('pager__link', current == key ? ' is-active') }}>
            {% endif %}
            <span class="visually-hidden">
              {{ current == key ? 'Current page'|t : 'Page'|t }}
              {{ 'Page'|t }}
            </span>
            {{ key }}
            {% if current != key %}
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
          {% endif %}
          <a href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title') }}>
            <span class="visually-hidden">
              {{ current == key ? 'Current page'|t : 'Page'|t }}
              {{ 'Page'|t }}
            </span>
            {{- key -}}
          </a>
Loading