File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,16 @@ export default function connectAxesToLayout(WrappedComponent) {
48
48
49
49
this . axes = getAllAxes ( context . fullContainer ) ;
50
50
this . axesOptions = computeAxesOptions ( this . axes , props , context ) ;
51
- const defaultAxesTarget = this . axesOptions . length
52
- ? this . axesOptions [ 0 ] . value
53
- : null ;
51
+
52
+ // this.axesOptions can be an empty array when we have a filter on an AxesFold
53
+ // and no axes correspond to the condition
54
+ let defaultAxesTarget = null ;
55
+ if ( this . axesOptions . length === 1 ) {
56
+ defaultAxesTarget = this . axesOptions [ 0 ] . value ;
57
+ }
58
+ if ( this . axesOptions . length > 1 ) {
59
+ defaultAxesTarget = this . axesOptions [ 1 ] . value ;
60
+ }
54
61
55
62
this . state = {
56
63
axesTarget : defaultAxesTarget ,
You can’t perform that action at this time.
0 commit comments