File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/charts/ScenarioManagerTreeList Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ import useStyles from './style';
13
13
import { ScenarioNode } from '../../cards' ;
14
14
import { SHRUNK_NODE_HEIGHT , EXPANDED_NODE_HEIGHT } from '../../cards/ScenarioNode/constants' ;
15
15
16
- const initNodesDict = ( scenarios ) => {
16
+ const initNodesDict = ( scenarios , defaultExpanded ) => {
17
17
const nodesDict = { } ;
18
18
scenarios . forEach ( ( scenario ) => {
19
- nodesDict [ scenario . id ] = false ;
19
+ nodesDict [ scenario . id ] = defaultExpanded ;
20
20
} ) ;
21
21
return nodesDict ;
22
22
} ;
@@ -43,8 +43,8 @@ export const ScenarioManagerTreeList = (props) => {
43
43
44
44
// Memoize the full scenarios tree in a ReactSortableTree-compatible format
45
45
const [ searchText , setSearchText ] = useState ( '' ) ;
46
- const [ nodesExpandedChildren , setNodesExpandedChildren ] = useState ( initNodesDict ( scenarios ) ) ;
47
- const [ nodesExpandedDetails , setNodesExpandedDetails ] = useState ( initNodesDict ( scenarios ) ) ;
46
+ const [ nodesExpandedChildren , setNodesExpandedChildren ] = useState ( initNodesDict ( scenarios , true ) ) ;
47
+ const [ nodesExpandedDetails , setNodesExpandedDetails ] = useState ( initNodesDict ( scenarios , false ) ) ;
48
48
49
49
const collapseAll = ( ) => {
50
50
const newValue = { } ;
You can’t perform that action at this time.
0 commit comments