File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
client/packages/lowcoder/src/comps/comps/moduleComp Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ const childrenMap = {
8585 events : eventHandlerControl ( ) ,
8686 autoHeight : AutoHeightControl ,
8787 scrollbars : withDefault ( BoolControl , false ) ,
88+ loadInDomWhenHide : withDefault ( BoolControl , true ) ,
8889} ;
8990
9091type DataType = ToDataType < ToInstanceType < typeof childrenMap > > ;
@@ -127,6 +128,9 @@ class ModuleTmpComp extends ModuleCompBase {
127128 label : trans ( "prop.scrollbar" ) ,
128129 } ) }
129130 { hiddenPropertyView ( this . children ) }
131+ { this . children . hidden . getView ( ) && this . children . loadInDomWhenHide . propertyView ( {
132+ label : "Load module in DOM when hidden" ,
133+ } ) }
130134 </ Section >
131135 </ >
132136 ) ;
@@ -525,6 +529,9 @@ const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
525529 if ( error ) {
526530 return < Placeholder > { error } </ Placeholder > ;
527531 }
532+ if ( comp . children . hidden . getView ( ) && ! comp . children . loadInDomWhenHide . getView ( ) ) {
533+ return null ;
534+ }
528535
529536 let content : ReactNode = appId ? < ModuleLoading /> : < Placeholder /> ;
530537 if ( comp . moduleRootComp && comp . isReady ) {
You can’t perform that action at this time.
0 commit comments