diff --git a/resources/js/admin/auth-clients/components/AuthClientsListing.vue b/resources/js/admin/auth-clients/components/AuthClientsListing.vue index 6b55bcfa32..047a923fd7 100644 --- a/resources/js/admin/auth-clients/components/AuthClientsListing.vue +++ b/resources/js/admin/auth-clients/components/AuthClientsListing.vue @@ -148,6 +148,7 @@ export default { this.fetch(); }, onPageChange(page) { + const previousPage = this.page; if (page == "next") { this.page = this.page + 1; } else if (page == "prev") { @@ -162,6 +163,10 @@ export default { if (this.page > meta.last_page) { this.page = meta.last_page; } + // Skip fetch when nav is disabled (already on first/last) or page is unchanged + if (this.page === previousPage) { + return; + } this.fetch(); }, onNavigate(action, data) { diff --git a/resources/js/components/common/Pagination.vue b/resources/js/components/common/Pagination.vue index ce77a9f252..47854722bb 100644 --- a/resources/js/components/common/Pagination.vue +++ b/resources/js/components/common/Pagination.vue @@ -123,10 +123,14 @@ export default { } &.disabled { cursor: not-allowed; + opacity: 0.5 !important; } &:hover { background-color: white; } + &:hover.disabled { + background-color: #f7f9fb; + } } .pagination-nav-drop { width: 40px; diff --git a/resources/js/components/common/mixins/datatable.js b/resources/js/components/common/mixins/datatable.js index 45521acb4d..069079fcc1 100644 --- a/resources/js/components/common/mixins/datatable.js +++ b/resources/js/components/common/mixins/datatable.js @@ -117,6 +117,7 @@ export default { }, // Handler to change the page based on events fired from our pagination component onPageChange(page) { + const previousPage = this.page; if (page === "next") { this.page += 1; } else if (page === "prev") { @@ -130,6 +131,16 @@ export default { if (this.page > this.data.meta.last_page) { this.page = this.data.meta.last_page; } + // Skip fetch when nav is disabled (already on first/last) or page is unchanged + if (this.page === previousPage) { + return; + } + this.fetch(); + }, + // Explicit refresh after mutations (delete/archive). + // onPageChange skips fetch when already on page 1. + refreshListing() { + this.page = 1; this.fetch(); }, }, diff --git a/resources/js/components/shared/processNavigation.js b/resources/js/components/shared/processNavigation.js index 313f5e3b46..0de9d76716 100644 --- a/resources/js/components/shared/processNavigation.js +++ b/resources/js/components/shared/processNavigation.js @@ -73,7 +73,7 @@ export default { this.$t("The process was archived."), "success" ); - this.$refs.pagination?.loadPage(1); + this.refreshListing(); }); } ); diff --git a/resources/js/templates/components/ProcessTemplatesListing.vue b/resources/js/templates/components/ProcessTemplatesListing.vue index d870997271..9a3131db54 100644 --- a/resources/js/templates/components/ProcessTemplatesListing.vue +++ b/resources/js/templates/components/ProcessTemplatesListing.vue @@ -298,7 +298,7 @@ this.$t("The process template was deleted."), "success" ); - this.$refs.pagination.loadPage(1); + this.refreshListing(); }); } );