From 626e4357d44eba25fb3e32486d3ca2e30f305f33 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 31 Jul 2024 10:46:52 +0100 Subject: [PATCH] fix(kpagination): ensure currentPage is highlighted (#2307) If your current page is not in the set of page buttons that KPagination defaults to (e.g. [1] [2] [3] [...] [20] with a current page of `7`). This fix ensures that the correct set of page buttons is displayed plus highlights the button that corresponds to the current page. I also added an example to the sandbox which I used to figure this out. FYI: Our use case is that we always pass bookmarkable `?page=7` parameters to our pages, previous to this fix a '7 page button' would not be shown or highlighted, also see https://github.com/kumahq/kuma-gui/issues/2769 --------- Signed-off-by: John Cowen --- sandbox/pages/SandboxPagination.vue | 22 ++++++++++++++++++++-- src/components/KPagination/KPagination.vue | 8 +++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sandbox/pages/SandboxPagination.vue b/sandbox/pages/SandboxPagination.vue index 62f70e0e50..2506976ebf 100644 --- a/sandbox/pages/SandboxPagination.vue +++ b/sandbox/pages/SandboxPagination.vue @@ -15,6 +15,15 @@ @page-size-change="handlePageSizeChange" /> + + +