Skip to content

Commit 2904133

Browse files
committed
Merge branch 'madeinfree-fixed-#578'
2 parents a730833 + c5c53f4 commit 2904133

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/BootstrapTable.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@ class BootstrapTable extends Component {
880880
}
881881

882882
_adjustHeight = () => {
883-
if (this.props.height.indexOf('%') === -1) {
883+
if ((typeof this.props.height === 'number' && !isNaN(this.props.height)) ||
884+
this.props.height.indexOf('%') === -1) {
884885
this.refs.body.refs.container.style.height =
885886
parseFloat(this.props.height, 10) - this.refs.header.refs.container.offsetHeight + 'px';
886887
}
@@ -912,8 +913,8 @@ class BootstrapTable extends Component {
912913

913914
BootstrapTable.propTypes = {
914915
keyField: PropTypes.string,
915-
height: PropTypes.string,
916-
maxHeight: PropTypes.string,
916+
height: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
917+
maxHeight: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
917918
data: PropTypes.oneOfType([ PropTypes.array, PropTypes.object ]),
918919
remote: PropTypes.bool, // remote data, default is false
919920
striped: PropTypes.bool,

0 commit comments

Comments
 (0)