Skip to content

Commit

Permalink
chore: patch cls for rtl (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored May 18, 2023
1 parent 254373a commit e6c33d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
const [scrollTop, setScrollTop] = useState(0);
const [scrollMoving, setScrollMoving] = useState(false);

const mergedClassName = classNames(prefixCls, className);
const mergedClassName = classNames(
prefixCls,
{ [`${prefixCls}-rtl`]: direction === 'rtl' },
className,
);
const mergedData = data || EMPTY_DATA;
const componentRef = useRef<HTMLDivElement>();
const fillerInnerRef = useRef<HTMLDivElement>();
Expand Down
2 changes: 2 additions & 0 deletions tests/scroll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,7 @@ describe('List.Scroll', () => {
);
expect(wrapper.find('.rc-virtual-list-scrollbar').props().style.left).toEqual(0);
jest.useRealTimers();

expect(wrapper.exists('.rc-virtual-list-rtl')).toBeTruthy();
});
});

0 comments on commit e6c33d2

Please sign in to comment.