Merge pull request #19 from WinterSilence/patch-2
Fix value of attribute aria-current in LinkPager
This commit is contained in:
commit
9be83b526a
@ -5,6 +5,7 @@ Yii Framework 2 bootstrap5 extension Change Log
|
||||
-----------------------
|
||||
|
||||
- Enh #18: Add rangeInput(), colorInput() and switch mode to checkbox() in class ActiveField (WinterSilence)
|
||||
- Bug #19: Fix value of attribute "aria-current" in LinkPager::renderPageButton() (WinterSilence)
|
||||
|
||||
|
||||
2.0.2 October 21, 2021
|
||||
|
@ -285,13 +285,13 @@ class LinkPager extends Widget
|
||||
{
|
||||
$options = $this->linkContainerOptions;
|
||||
$linkWrapTag = ArrayHelper::remove($options, 'tag', 'li');
|
||||
Html::addCssClass($options, empty($class) ? $this->pageCssClass : $class);
|
||||
Html::addCssClass($options, $class ?: $this->pageCssClass);
|
||||
|
||||
$linkOptions = $this->linkOptions;
|
||||
$linkOptions['data-page'] = $page;
|
||||
|
||||
if ($active) {
|
||||
$options['aria'] = ['current' => 'true'];
|
||||
$options['aria'] = ['current' => 'page'];
|
||||
Html::addCssClass($options, $this->activePageCssClass);
|
||||
}
|
||||
if ($disabled) {
|
||||
|
@ -70,12 +70,12 @@ class LinkPagerTest extends TestCase
|
||||
'pagination' => $pagination,
|
||||
'disableCurrentPageButton' => false,
|
||||
]);
|
||||
$this->assertContains('<li class="page-item active" aria-current="true"><a class="page-link" href="/?r=test&page=6" data-page="5">6</a></li>', $output);
|
||||
$this->assertContains('<li class="page-item active" aria-current="page"><a class="page-link" href="/?r=test&page=6" data-page="5">6</a></li>', $output);
|
||||
$output = LinkPager::widget([
|
||||
'pagination' => $pagination,
|
||||
'disableCurrentPageButton' => true,
|
||||
]);
|
||||
$this->assertContains('<li class="page-item active disabled" aria-current="true"><a class="page-link" href="/?r=test&page=6" data-page="5" tabindex="-1">6</a></li>', $output);
|
||||
$this->assertContains('<li class="page-item active disabled" aria-current="page"><a class="page-link" href="/?r=test&page=6" data-page="5" tabindex="-1">6</a></li>', $output);
|
||||
}
|
||||
|
||||
public function testOptionsWithTagOption()
|
||||
@ -105,7 +105,7 @@ class LinkPagerTest extends TestCase
|
||||
$output
|
||||
);
|
||||
$this->assertContains(
|
||||
'<div class="my-class page-item active" aria-current="true"><a class="page-link" href="/?r=test&page=2" data-page="1">2</a></div>',
|
||||
'<div class="my-class page-item active" aria-current="page"><a class="page-link" href="/?r=test&page=2" data-page="1">2</a></div>',
|
||||
$output
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user