Skip to content

Commit 7db2d43

Browse files
authored
Merge pull request #128 from react-component/fixed-column-vertical-scroll
Set maxHeight to inner body
2 parents 048aaa3 + 0629f23 commit 7db2d43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Table.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,13 @@ export default class Table extends React.Component {
428428
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
429429
}
430430

431+
const innerBodyStyle = {};
431432
if (scroll.y) {
432433
// maxHeight will make fixed-Table scrolling not working
433434
// so we only set maxHeight to body-Table here
434435
if (fixed) {
435-
bodyStyle.height = bodyStyle.height || scroll.y;
436+
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
437+
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
436438
} else {
437439
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
438440
}
@@ -520,6 +522,7 @@ export default class Table extends React.Component {
520522
>
521523
<div
522524
className={`${prefixCls}-body-inner`}
525+
style={innerBodyStyle}
523526
ref={refName}
524527
onMouseOver={this.detectScrollTarget}
525528
onTouchStart={this.detectScrollTarget}

0 commit comments

Comments
 (0)