Skip to content

Commit 5a67705

Browse files
authored
fix: Measure cell should keep in touch (#479)
1 parent cfb0469 commit 5a67705

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
@@ -59,6 +59,7 @@
5959
},
6060
"devDependencies": {
6161
"@types/classnames": "^2.2.9",
62+
"@types/enzyme": "^3.10.5",
6263
"@types/jest": "^25.1.0",
6364
"@types/react": "^16.9.2",
6465
"@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)