Skip to content

Commit

Permalink
fix(pagination): 修复 onJump 事件没有触发的问题(#2929) (#2930)
Browse files Browse the repository at this point in the history
* fix(pagination): 修复onJump事件没有触发的问题(#2929)

* chore(pagination): 生成变更记录文件

* feat(pagination): refactor onJump

---------

Co-authored-by: xiamiao <[email protected]>
  • Loading branch information
xiamiao1121 and xiamiao authored Jul 24, 2024
1 parent 369cdf9 commit c238c5d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-plums-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

fix(pagination): 修复 onJump 事件不触发的问题
5 changes: 5 additions & 0 deletions .changeset/short-timers-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/pagination": patch
---

fix: 修复 onJump 事件不触发的问题
6 changes: 5 additions & 1 deletion packages/ui/pagination/src/DefaultPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const DefaultPagination = forwardRef<HTMLDivElement | null, PaginationPro
pageSize: pageSizeProp,
max = 2,
total,
onJump,
onPageSizeChange,
showTotal,
showJumper,
Expand Down Expand Up @@ -191,7 +192,10 @@ export const DefaultPagination = forwardRef<HTMLDivElement | null, PaginationPro
<PageJumper
prefixCls={prefixCls}
pageText={[gotoText, pageText]}
onJump={proxyTrySetCurrent}
onJump={(page) => {
proxyTrySetCurrent(page)
onJump?.(page)
}}
maxJump={calculatePageCount(total, pageSize)}
/>
) : null}
Expand Down

0 comments on commit c238c5d

Please sign in to comment.