File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,7 @@ export default class CompositeListSelection {
14
14
this . selections . push ( selection )
15
15
}
16
16
17
- this . activeSelectionIndex = 0
18
- for ( var i = 0 ; i < this . selections . length ; i ++ ) {
19
- if ( this . selections [ i ] . getItems ( ) . length ) {
20
- this . activeSelectionIndex = i
21
- break
22
- }
23
- }
17
+ this . selectFirstNonEmptyList ( )
24
18
}
25
19
26
20
updateLists ( listsByKey ) {
@@ -38,6 +32,16 @@ export default class CompositeListSelection {
38
32
}
39
33
}
40
34
35
+ selectFirstNonEmptyList ( ) {
36
+ this . activeSelectionIndex = 0
37
+ for ( var i = 0 ; i < this . selections . length ; i ++ ) {
38
+ if ( this . selections [ i ] . getItems ( ) . length ) {
39
+ this . activeSelectionIndex = i
40
+ break
41
+ }
42
+ }
43
+ }
44
+
41
45
getActiveListKey ( ) {
42
46
return this . keysBySelection . get ( this . getActiveSelection ( ) )
43
47
}
You can’t perform that action at this time.
0 commit comments