Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitecea950

Browse files
fixed listview item's loses context on changing position
1 parentdf479c6 commitecea950

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

‎client/packages/lowcoder/src/comps/generators/withMultiContext.tsx‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ export function withMultiContext<TCtor extends MultiCompConstructor>(VariantComp
125125
constparams=this.cacheParamsMap.get(key);
126126
if(_.isNil(comp)&&!_.isNil(params)){
127127
constmapComps=this.getMap();
128-
if(mapComps.hasOwnProperty(key)&&!paramsEqual(params,mapComps[key].getParams())){
128+
if(
129+
Object.keys(mapComps).length===Object.keys(this.cacheParamsMap.getMap()).length
130+
&&mapComps.hasOwnProperty(key)
131+
&&!paramsEqual(params,mapComps[key].getParams())
132+
){
129133
// refresh the item, since params changed
130134
// this.dispatch(deferAction(wrapChildAction(MAP_KEY, MapCtor.batchDeleteAction([key]))));
131135
this.dispatch(wrapChildAction(MAP_KEY,MapCtor.batchDeleteAction([key])));
@@ -177,16 +181,18 @@ export function withMultiContext<TCtor extends MultiCompConstructor>(VariantComp
177181
constparams=comp.cacheParamsMap.get(key);
178182
if(params){
179183
constchildComp=comp
180-
.getComp(key)!
184+
.getOriginalComp()
181185
.setParams(params)
182186
.changeDispatch(wrapDispatch(wrapDispatch(comp.dispatch,MAP_KEY),key));
183187
constnewChildComp=childComp.reduce(childAction);
184188

185-
constcomps={[key]:newChildComp};
186-
comp=comp.setChild(
187-
MAP_KEY,
188-
comp.children[MAP_KEY].reduce(MapCtor.batchSetCompAction(comps))
189-
);
189+
if(childComp!==newChildComp){
190+
constcomps={[key]:newChildComp};
191+
comp=comp.setChild(
192+
MAP_KEY,
193+
comp.children[MAP_KEY].reduce(MapCtor.batchSetCompAction(comps))
194+
);
195+
}
190196
}
191197
}else{
192198
comp=super.reduce(action);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp