Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,10 @@ const Pagination: React.FC<PaginationProps> = (props) => {
onClick={prevHandle}
tabIndex={prevDisabled ? null : 0}
onKeyDown={runIfEnterPrev}
className={classNames(`${prefixCls}-prev`, {
className={classNames(`${prefixCls}-prev`, paginationClassNames?.item, {
[`${prefixCls}-disabled`]: prevDisabled,
})}
style={styles?.item}
aria-disabled={prevDisabled}
>
{prev}
Expand All @@ -551,9 +552,10 @@ const Pagination: React.FC<PaginationProps> = (props) => {
onClick={nextHandle}
tabIndex={nextTabIndex}
onKeyDown={runIfEnterNext}
className={classNames(`${prefixCls}-next`, {
className={classNames(`${prefixCls}-next`, paginationClassNames?.item, {
[`${prefixCls}-disabled`]: nextDisabled,
})}
style={styles?.item}
aria-disabled={nextDisabled}
>
{next}
Expand Down
18 changes: 18 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,26 @@ describe('Other props', () => {
/>,
);
const item = container.querySelector('.rc-pagination-item');
const prev = container.querySelector('.rc-pagination-prev');
const next = container.querySelector('.rc-pagination-next');
expect(item).toHaveClass('custom-test');
expect(prev).toHaveClass('custom-test');
expect(next).toHaveClass('custom-test');
expect(item).toHaveStyle('color: red');
expect(prev).toHaveStyle('color: red');
expect(next).toHaveStyle('color: red');
});
it('should have 5 items when there are 3 pages and current page is 2', () => {
const { container } = render(
<Pagination
total={15}
pageSize={5}
current={2}
classNames={{ item: 'custom-test' }}
/>,
);
const items = container.querySelectorAll('.custom-test');
expect(items.length).toBe(5);
});
it('should support custom default icon', () => {
const nextIcon = () => <span>nextIcon</span>;
Expand Down
Loading