Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2aef4eb

Browse files
fix #1377
1 parent 380358d commit 2aef4eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎packages/react-bootstrap-table2/src/contexts/row-expand-context.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ class RowExpandProvider extends React.Component {
2323

2424
UNSAFE_componentWillReceiveProps(nextProps) {
2525
if (nextProps.expandRow) {
26-
const nextExpanded = nextProps.expandRow.expanded || this.state.expanded;
26+
let nextExpanded = [...(nextProps.expandRow.expanded || this.state.expanded)];
27+
const { nonExpandable = [] } = nextProps.expandRow;
28+
nextExpanded = nextExpanded.filter(rowId => !_.contains(nonExpandable, rowId));
2729
const isClosing = this.state.expanded.reduce((acc, cur) => {
2830
if (!_.contains(nextExpanded, cur)) {
2931
acc.push(cur);
3032
}
3133
return acc;
3234
}, []);
35+
3336
this.setState(() => ({
3437
expanded: nextExpanded,
3538
isClosing

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /