Content-Length: 308758 | pFad | http://github.com/lowcoder-org/lowcoder/commit/511d57cc7e93b9cb6eb29f8e33b489ee53177159

60 fixed context issue in module when used inside list/grid · lowcoder-org/lowcoder@511d57c · GitHub
Skip to content

Commit 511d57c

Browse files
fixed context issue in module when used inside list/grid
1 parent e551a05 commit 511d57c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

client/packages/lowcoder/src/comps/comps/moduleComp/moduleComp.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ class ModuleTmpComp extends ModuleCompBase {
221221

222222
override changeDispatch(dispatch: DispatchType) {
223223
const next = super.changeDispatch(dispatch);
224-
const nextModuleRootComp = this.moduleRootComp?.changeDispatch(next.getModuleDispatchFn());
224+
const nextModuleRootComp = this.moduleRootComp?.changeDispatch(
225+
this.getModuleDispatchFn(next.dispatch)
226+
);
225227
if (!nextModuleRootComp) {
226-
return next;
228+
return this;
227229
}
228230
return setFieldsNoTypeCheck(
229231
next,
@@ -234,10 +236,10 @@ class ModuleTmpComp extends ModuleCompBase {
234236
);
235237
}
236238

237-
getModuleDispatchFn() {
239+
getModuleDispatchFn(dispatch: DispatchType) {
238240
return (action: CompAction<any>) => {
239241
// log.info("dispatch from module:", action);
240-
this.dispatch(
242+
dispatch(
241243
customAction(
242244
{
243245
type: "delegated",
@@ -305,7 +307,7 @@ class ModuleTmpComp extends ModuleCompBase {
305307
if (getReduceContext().disableUpdateState) return this;
306308
const { dsl, moduleDsl } = action.value;
307309
const moduleRootComp = new RootComp({
308-
dispatch: this.getModuleDispatchFn(),
310+
dispatch: this.getModuleDispatchFn(this.dispatch),
309311
value: dsl,
310312
});
311313
moduleRootComp.setModuleRoot(true);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/commit/511d57cc7e93b9cb6eb29f8e33b489ee53177159

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy