Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: overflowY = 'auto' when set scroll.y #973

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<Reco

if (fixHeader) {
scrollYStyle = {
overflowY: 'scroll',
overflowY: 'auto',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto will break the width calculation which makes border out of table:
截屏2023-08-15 10 02 02

maxHeight: scroll.y,
};
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Scroll.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Table.Scroll', () => {
it('renders scroll.x and scroll.y are both true', () => {
const wrapper = mount(createTable({ scroll: { x: true, y: 200 } }));
expect(wrapper.find('.rc-table-body').props().style.overflowX).toEqual('auto');
expect(wrapper.find('.rc-table-body').props().style.overflowY).toEqual('scroll');
expect(wrapper.find('.rc-table-body').props().style.overflowY).toEqual('auto');
});

it('fire scroll event', () => {
Expand Down
Loading