Skip to content

Commit 2b58b22

Browse files
fix(Pagination): incorrect pagination jump (#2975)
发现 分页组件有点 问题,具体为 : 假设 每页5条数据,当 到第5页时会出现 ... ,点击这个 ... 会跳转到 最后一页,同理 下一页的 ...也会出现; 这时应该 为 上一页 为 1,同理 下一页为 最后一页即 InternalPageCount, Signed-off-by: SuperPigBlog <[email protected]> Co-authored-by: Argo Zhang <[email protected]>
1 parent 5c8a69e commit 2b58b22

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BootstrapBlazor/Components/Pagination/Pagination.razor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ protected async Task MovePrev(int index)
181181
var pageIndex = InternalPageIndex - index;
182182
if (pageIndex < 1)
183183
{
184-
pageIndex = InternalPageCount;
184+
//pageIndex = InternalPageCount;
185+
pageIndex = 1;
185186
}
186187
await OnPageItemClick(pageIndex);
187188
}
@@ -194,7 +195,8 @@ protected async Task MoveNext(int index)
194195
var pageIndex = InternalPageIndex + index;
195196
if (pageIndex > InternalPageCount)
196197
{
197-
pageIndex = 1;
198+
//pageIndex = 1;
199+
pageIndex = InternalPageCount;
198200
}
199201
await OnPageItemClick(pageIndex);
200202
}

0 commit comments

Comments
 (0)