From fba4a7fc58b32c112b5a684a9a8f6d4e784444c1 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Fri, 31 May 2024 07:59:51 +0400 Subject: [PATCH] fix bug with nav button right nav button was not disabled when total_pages=0 --- src/views/Pagination.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Pagination.php b/src/views/Pagination.php index 729d1cd..56dd65e 100644 --- a/src/views/Pagination.php +++ b/src/views/Pagination.php @@ -45,7 +45,7 @@ function displayNavigationButton(int $current_page_number, int $total_pages, str $link_content = htmlspecialchars($is_left ? "<" : ">"); $className = "page-item"; - if (($current_page_number === 1 && $is_left) || ($current_page_number === $total_pages && !$is_left)) { + if (($current_page_number <= 1 && $is_left) || ($current_page_number >= $total_pages && !$is_left)) { $className .= " disabled"; }