File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/react-bootstrap-table2/src/contexts Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,16 @@ class RowExpandProvider extends React.Component {
23
23
24
24
UNSAFE_componentWillReceiveProps ( nextProps ) {
25
25
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 ) ) ;
27
29
const isClosing = this . state . expanded . reduce ( ( acc , cur ) => {
28
30
if ( ! _ . contains ( nextExpanded , cur ) ) {
29
31
acc . push ( cur ) ;
30
32
}
31
33
return acc ;
32
34
} , [ ] ) ;
35
+
33
36
this . setState ( ( ) => ( {
34
37
expanded : nextExpanded ,
35
38
isClosing
You can’t perform that action at this time.
0 commit comments