Skip to content

Commit 4b1e11e

Browse files
committed
fix #1116 - iterate through real child
1 parent 2fcb24f commit 4b1e11e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/BootstrapTable.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -1271,12 +1271,17 @@ class BootstrapTable extends Component {
12711271
}
12721272
}
12731273
} else {
1274-
React.Children.forEach(this.props.children.filter(_ => !!_), (child, i) => {
1275-
if (child.props.width) {
1276-
header[i].style.width = `${child.props.width}px`;
1277-
header[i].style.minWidth = `${child.props.width}px`;
1274+
for (const i in bodyHeader) {
1275+
if (bodyHeader.hasOwnProperty(i)) {
1276+
const child = bodyHeader[i];
1277+
if (child.style.width) {
1278+
header[i].style.width = child.style.width;
1279+
}
1280+
if (child.style.minWidth) {
1281+
header[i].style.minWidth = child.style.minWidth;
1282+
}
12781283
}
1279-
});
1284+
}
12801285
}
12811286
this.isVerticalScroll = isScroll;
12821287
}

0 commit comments

Comments
 (0)