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/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
}

if (horizonScroll) {
scrollXStyle = { overflowX: 'scroll' };
scrollXStyle = { overflowX: 'auto' };
// When no vertical scrollbar, should hide it
// https://github.com/ant-design/ant-design/pull/20705
// https://github.com/ant-design/ant-design/issues/21879
Expand Down
4 changes: 2 additions & 2 deletions tests/Scroll.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Table.Scroll', () => {
it('renders scroll.x is true', () => {
const wrapper = mount(createTable({ scroll: { x: true } }));
expect(wrapper.find('table').props().style.width).toEqual('auto');
expect(wrapper.find('.rc-table-content').props().style.overflowX).toEqual('scroll');
expect(wrapper.find('.rc-table-content').props().style.overflowX).toEqual('auto');
expect(wrapper.find('.rc-table-content').props().style.overflowY).toEqual('hidden');
});

Expand All @@ -31,7 +31,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('scroll');
expect(wrapper.find('.rc-table-body').props().style.overflowX).toEqual('auto');
expect(wrapper.find('.rc-table-body').props().style.overflowY).toEqual('scroll');
});

Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/ExpandRow.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ exports[`Table.Expand renders fixed column correctly work 1`] = `
>
<div
class="rc-table-content"
style="overflow-x: scroll; overflow-y: hidden;"
style="overflow-x: auto; overflow-y: hidden;"
>
<table
style="width: 903px; min-width: 100%; table-layout: fixed;"
Expand Down
10 changes: 5 additions & 5 deletions tests/__snapshots__/FixedColumn.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Table.FixedColumn fixed column renders correctly RTL 1`] = `
>
<div
class="rc-table-content"
style="overflow-x: scroll; overflow-y: hidden;"
style="overflow-x: auto; overflow-y: hidden;"
>
<table
style="width: 1px; min-width: 100%; table-layout: fixed;"
Expand Down Expand Up @@ -632,7 +632,7 @@ exports[`Table.FixedColumn renders correctly scrollX - with data 1`] = `
>
<div
class="rc-table-content"
style="overflow-x: scroll; overflow-y: hidden;"
style="overflow-x: auto; overflow-y: hidden;"
>
<table
style="width: 1200px; min-width: 100%; table-layout: fixed;"
Expand Down Expand Up @@ -1255,7 +1255,7 @@ exports[`Table.FixedColumn renders correctly scrollX - without data 1`] = `
>
<div
class="rc-table-content"
style="overflow-x: scroll; overflow-y: hidden;"
style="overflow-x: auto; overflow-y: hidden;"
>
<table
style="width: 1200px; min-width: 100%; table-layout: fixed;"
Expand Down Expand Up @@ -1526,7 +1526,7 @@ exports[`Table.FixedColumn renders correctly scrollXY - with data 1`] = `
</div>
<div
class="rc-table-body"
style="overflow-x: scroll; overflow-y: scroll; max-height: 100px;"
style="overflow-x: auto; overflow-y: scroll; max-height: 100px;"
>
<table
style="width: 1200px; min-width: 100%; table-layout: fixed;"
Expand Down Expand Up @@ -2080,7 +2080,7 @@ exports[`Table.FixedColumn renders correctly scrollXY - without data 1`] = `
>
<div
class="rc-table-content"
style="overflow-x: scroll; overflow-y: hidden;"
style="overflow-x: auto; overflow-y: hidden;"
>
<table
style="width: 1200px; min-width: 100%; table-layout: fixed;"
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/Table.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ exports[`Table.Basic custom components renders fixed column and header correctly
</div>
<div
class="rc-table-body"
style="overflow-x: scroll; overflow-y: scroll; max-height: 100px;"
style="overflow-x: auto; overflow-y: scroll; max-height: 100px;"
>
<table
name="my-table"
Expand Down