Skip to content

Commit 4912c43

Browse files
committed
fix: Measure cell should keep in touch (#479)
1 parent de1a97c commit 4912c43

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
},
5959
"devDependencies": {
6060
"@types/classnames": "^2.2.9",
61+
"@types/enzyme": "^3.10.5",
6162
"@types/jest": "^25.1.0",
6263
"@types/react": "^16.9.2",
6364
"@types/react-dom": "^16.9.0",

src/Body/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function Body<RecordType>({
114114
getComponent,
115115
componentWidth,
116116
emptyNode,
117+
flattenColumns,
117118
]);
118119
}
119120

tests/FixedColumn.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,13 @@ describe('Table.FixedColumn', () => {
188188
.hasClass('rc-table-cell-fix-left'),
189189
).toBeTruthy();
190190
});
191+
192+
it('not break measure count', () => {
193+
const wrapper = mount(<Table columns={columns.slice(0, 5)} data={data} scroll={{ x: 1000 }} />);
194+
expect(wrapper.find('.rc-table-measure-row td')).toHaveLength(5);
195+
196+
wrapper.setProps({ columns: columns.slice(0, 4) });
197+
wrapper.update();
198+
expect(wrapper.find('.rc-table-measure-row td')).toHaveLength(4);
199+
});
191200
});

0 commit comments

Comments
 (0)