Skip to content

Commit 1af8f37

Browse files
committed
chore: fix items missing
1 parent c902e92 commit 1af8f37

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/Pagination.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ const Pagination: React.FC<PaginationProps> = (props) => {
381381
simplePager = (
382382
<li
383383
title={showTitle ? `${current}/${allPages}` : null}
384-
className={`${prefixCls}-simple-pager`}
384+
className={clsx(
385+
`${prefixCls}-simple-pager`,
386+
paginationClassNames?.item,
387+
)}
388+
style={styles?.item}
385389
>
386390
{isReadOnly ? (
387391
internalInputVal

tests/simple.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,22 @@ describe('simple Pagination', () => {
305305
const { container } = render(<Pagination simple={{ readOnly: true }} />);
306306
expect(container).toMatchSnapshot();
307307
});
308+
309+
it('should apply semantic item styles to simplePager', () => {
310+
const customClassName = 'custom-item-class';
311+
const customStyle = { backgroundColor: 'red' };
312+
313+
const { container } = render(
314+
<Pagination
315+
simple
316+
total={25}
317+
classNames={{ item: customClassName }}
318+
styles={{ item: customStyle }}
319+
/>,
320+
);
321+
322+
const simplePager = container.querySelector('.rc-pagination-simple-pager');
323+
expect(simplePager).toHaveClass(customClassName);
324+
expect(simplePager).toHaveStyle('background-color: red');
325+
});
308326
});

0 commit comments

Comments
 (0)