Skip to content

Commit dcc54d2

Browse files
committed
fix #666
1 parent 18f1acd commit dcc54d2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/BootstrapTable.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,19 @@ class BootstrapTable extends Component {
914914
}
915915

916916
_adjustHeight = () => {
917-
if ((typeof this.props.height === 'number' && !isNaN(this.props.height)) ||
918-
this.props.height.indexOf('%') === -1) {
917+
const { height } = this.props;
918+
let { maxHeight } = this.props;
919+
if ((typeof height === 'number' && !isNaN(height)) || height.indexOf('%') === -1) {
919920
this.refs.body.refs.container.style.height =
920-
parseFloat(this.props.height, 10) - this.refs.header.refs.container.offsetHeight + 'px';
921+
parseFloat(height, 10) - this.refs.header.refs.container.offsetHeight + 'px';
922+
}
923+
if (maxHeight) {
924+
maxHeight = typeof maxHeight === 'number' ?
925+
maxHeight :
926+
parseInt(maxHeight.replace('px', ''), 10);
927+
928+
this.refs.body.refs.container.style.maxHeight =
929+
maxHeight - this.refs.header.refs.container.offsetHeight + 'px';
921930
}
922931
}
923932

0 commit comments

Comments
 (0)