We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 380358d commit 2aef4ebCopy full SHA for 2aef4eb
1 file changed
packages/react-bootstrap-table2/src/contexts/row-expand-context.js
@@ -23,13 +23,16 @@ class RowExpandProvider extends React.Component {
23
24
UNSAFE_componentWillReceiveProps(nextProps) {
25
if (nextProps.expandRow) {
26
- const nextExpanded = nextProps.expandRow.expanded || this.state.expanded;
+ let nextExpanded = [...(nextProps.expandRow.expanded || this.state.expanded)];
27
+ const { nonExpandable = [] } = nextProps.expandRow;
28
+ nextExpanded = nextExpanded.filter(rowId => !_.contains(nonExpandable, rowId));
29
const isClosing = this.state.expanded.reduce((acc, cur) => {
30
if (!_.contains(nextExpanded, cur)) {
31
acc.push(cur);
32
}
33
return acc;
34
}, []);
35
+
36
this.setState(() => ({
37
expanded: nextExpanded,
38
isClosing
0 commit comments