File tree 1 file changed +7
-0
lines changed
client/packages/lowcoder/src/comps/comps/moduleComp
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ const childrenMap = {
85
85
events : eventHandlerControl ( ) ,
86
86
autoHeight : AutoHeightControl ,
87
87
scrollbars : withDefault ( BoolControl , false ) ,
88
+ loadInDomWhenHide : withDefault ( BoolControl , true ) ,
88
89
} ;
89
90
90
91
type DataType = ToDataType < ToInstanceType < typeof childrenMap > > ;
@@ -127,6 +128,9 @@ class ModuleTmpComp extends ModuleCompBase {
127
128
label : trans ( "prop.scrollbar" ) ,
128
129
} ) }
129
130
{ hiddenPropertyView ( this . children ) }
131
+ { this . children . hidden . getView ( ) && this . children . loadInDomWhenHide . propertyView ( {
132
+ label : "Load module in DOM when hidden" ,
133
+ } ) }
130
134
</ Section >
131
135
</ >
132
136
) ;
@@ -525,6 +529,9 @@ const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
525
529
if ( error ) {
526
530
return < Placeholder > { error } </ Placeholder > ;
527
531
}
532
+ if ( comp . children . hidden . getView ( ) && ! comp . children . loadInDomWhenHide . getView ( ) ) {
533
+ return null ;
534
+ }
528
535
529
536
let content : ReactNode = appId ? < ModuleLoading /> : < Placeholder /> ;
530
537
if ( comp . moduleRootComp && comp . isReady ) {
You can’t perform that action at this time.
0 commit comments