File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/components/containers Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Fold extends Component {
26
26
this . foldVisible = false ;
27
27
28
28
React . Children . forEach ( nextProps . children , child => {
29
- if ( child . props . attr ) {
29
+ if ( child && child . props . attr ) {
30
30
let plotProps ;
31
31
if ( child . type . supplyPlotProps ) {
32
32
plotProps = child . type . supplyPlotProps ( child . props , nextContext ) ;
@@ -42,6 +42,18 @@ class Fold extends Component {
42
42
return ;
43
43
}
44
44
}
45
+
46
+ // allow custom components in folds to automatically show up,
47
+ // except for Folds of Folds, which should keep their visibility rules
48
+ if (
49
+ child &&
50
+ ( ! child . type . plotly_editor_traits ||
51
+ ( child . type . plotly_editor_traits &&
52
+ ! child . type . plotly_editor_traits . foldable ) )
53
+ ) {
54
+ this . foldVisible = true ;
55
+ return ;
56
+ }
45
57
} ) ;
46
58
}
47
59
You can’t perform that action at this time.
0 commit comments