From 2a6ab7706d0753bf493792ea777bd9f25806efb0 Mon Sep 17 00:00:00 2001 From: Ferit Date: Wed, 21 Oct 2026 09:26:45 +0300 Subject: [PATCH] fix: set correct tabIndex for next button in simple mode --- src/Pagination.tsx | 2 +- tests/__snapshots__/demo.test.tsx.snap | 9 ++++++++- tests/simple.test.tsx | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 2ca06bd8..56bc0387 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -595,7 +595,7 @@ const Pagination: React.FC = (props) => { if (simple) { nextDisabled = !hasNext; - nextTabIndex = hasPrev ? 0 : null; + nextTabIndex = nextDisabled ? null : 0; } else { nextDisabled = !hasNext || !allPages; nextTabIndex = nextDisabled ? null : 0; diff --git a/tests/__snapshots__/demo.test.tsx.snap b/tests/__snapshots__/demo.test.tsx.snap index 2b1ffd7e..d7370155 100644 --- a/tests/__snapshots__/demo.test.tsx.snap +++ b/tests/__snapshots__/demo.test.tsx.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Example align 1`] = `
@@ -2704,6 +2704,7 @@ exports[`Example jumperWithGoButton 1`] = ` aria-label="下一页" class="rc-pagination-next" role="button" + tabindex="0" >