mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
This reverts commit 629caccaae
.
This commit is contained in:
parent
150bd23d53
commit
9ec2709b16
@ -553,30 +553,4 @@ describe('Table.pagination', () => {
|
||||
'ant-pagination ant-table-pagination ant-table-pagination-right pagination',
|
||||
);
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/33374
|
||||
// https://codesandbox.io/s/festive-edison-6uq3e?file=/src/App.js
|
||||
it('should called onChange when page number is changed by change of total ', () => {
|
||||
const onChange = jest.fn();
|
||||
const wrapper = mount(
|
||||
createTable({
|
||||
pagination: {
|
||||
current: 2,
|
||||
pageSize: 3,
|
||||
total: 4,
|
||||
onChange,
|
||||
},
|
||||
}),
|
||||
);
|
||||
wrapper.setProps({
|
||||
dataSource: data.slice(0, 3),
|
||||
pagination: {
|
||||
current: 2,
|
||||
pageSize: 3,
|
||||
total: 3,
|
||||
onChange,
|
||||
},
|
||||
});
|
||||
expect(onChange).toHaveBeenCalledWith(1, 3);
|
||||
});
|
||||
});
|
||||
|
@ -73,7 +73,6 @@ export default function usePagination(
|
||||
if (mergedPagination.current! > maxPage) {
|
||||
// Prevent a maximum page count of 0
|
||||
mergedPagination.current = maxPage || 1;
|
||||
mergedPagination.onChange?.(mergedPagination.current, mergedPagination?.pageSize!);
|
||||
}
|
||||
|
||||
const refreshPagination = (current?: number, pageSize?: number) => {
|
||||
|
Loading…
Reference in New Issue
Block a user