Skip to content

Commit e6c33d2

Browse files
authored
chore: patch cls for rtl (#204)
1 parent 254373a commit e6c33d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/List.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
8888
const [scrollTop, setScrollTop] = useState(0);
8989
const [scrollMoving, setScrollMoving] = useState(false);
9090

91-
const mergedClassName = classNames(prefixCls, className);
91+
const mergedClassName = classNames(
92+
prefixCls,
93+
{ [`${prefixCls}-rtl`]: direction === 'rtl' },
94+
className,
95+
);
9296
const mergedData = data || EMPTY_DATA;
9397
const componentRef = useRef<HTMLDivElement>();
9498
const fillerInnerRef = useRef<HTMLDivElement>();

tests/scroll.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,7 @@ describe('List.Scroll', () => {
305305
);
306306
expect(wrapper.find('.rc-virtual-list-scrollbar').props().style.left).toEqual(0);
307307
jest.useRealTimers();
308+
309+
expect(wrapper.exists('.rc-virtual-list-rtl')).toBeTruthy();
308310
});
309311
});

0 commit comments

Comments
 (0)