Skip to content

Commit e498d4a

Browse files
committed
fix: navigation with disabled items
1 parent ce7fe1e commit e498d4a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

projects/design-angular-kit/src/lib/components/core/pagination/pagination.component.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@if (pages.length) {
77
<ul class="pagination">
88
<li class="page-item" [class.disabled]="currentPage < 1">
9-
<a class="page-link" [class.text]="textLinks" href="#" (click)="pageChange($event, currentPage)">
9+
<a class="page-link" [class.text]="textLinks" href="#" (click)="!(currentPage < 1) && pageChange($event, currentPage)">
1010
@if (!textLinks) {
1111
<it-icon name="chevron-left" color="primary"></it-icon>
1212
}
@@ -45,7 +45,7 @@
4545
@for (page of pages; track page) {
4646
<li class="page-item">
4747
@if (page === currentPage + 1) {
48-
<a class="page-link" aria-current="page">
48+
<a class="page-link" href="#" aria-current="page">
4949
<span class="d-inline-block d-sm-none">{{ 'it.core.page' | translate }}</span> {{ page }}
5050
</a>
5151
} @else {
@@ -65,7 +65,11 @@
6565
}
6666
}
6767
<li class="page-item" [class.disabled]="currentPage >= pageNumbers - 1">
68-
<a class="page-link" [class.text]="textLinks" href="#" (click)="pageChange($event, currentPage + 2)">
68+
<a
69+
class="page-link"
70+
[class.text]="textLinks"
71+
href="#"
72+
(click)="!(currentPage >= pageNumbers - 1) && pageChange($event, currentPage + 2)">
6973
<span class="visually-hidden">
7074
{{ (textLinks ? 'it.core.page' : 'it.core.next-page') | translate }}
7175
</span>

0 commit comments

Comments
 (0)