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
2 changes: 1 addition & 1 deletion src/hooks/useColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function useColumns<RecordType>(
}, [mergedColumns, direction]);
// Only check out of production since it's waste for each render
if (process.env.NODE_ENV !== 'production') {
warningFixed(flattenColumns);
warningFixed(direction === 'rtl' ? flattenColumns.slice().reverse() : flattenColumns);
}
return [mergedColumns, flattenColumns];
}
Expand Down
6 changes: 6 additions & 0 deletions tests/FixedColumn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ describe('Table.FixedColumn', () => {
"Warning: Index 2 of `columns` missing `fixed='right'` prop.",
);
});

it('RTL', () => {
mount(<Table columns={[{}, { fixed: 'right' }]} direction="rtl" />);
expect(errorSpy).not.toHaveBeenCalled();
});
});

it('ellipsis will wrap additional dom', () => {
Expand All @@ -207,6 +212,7 @@ describe('Table.FixedColumn', () => {
);
expect(wrapper.render()).toMatchSnapshot();
});

it('has correct scroll classNames when table direction is RTL', () => {
const wrapper = mount(<Table columns={columns} data={data} direction="rtl" />);

Expand Down