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

Commit3ff5663

Browse files
committed
[Fix]:#1970,#1984 event handler context
1 parent428b59a commit3ff5663

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

‎client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,10 @@ function actionSelectorControl(needContext: boolean) {
249249
constcondition=this.children.condition.getView();
250250
constignored=getReduceContext().disableUpdateState||(isConditionSet&&!condition);
251251
constignorePromise=Promise.resolve();
252-
constrealNeedContext=needContext||getReduceContext().inEventContext;
253252
constactionPromise=()=>{
254-
//returnrealNeedContext ?action.value.func() : this.children.comp.getView()();
255-
// commenting because it's using old context for event handlers inside list/grid
256-
returnthis.children.comp.getView()();
253+
returnaction.value.context&&action.value.func
254+
?action.value.func()
255+
:this.children.comp.getView()();
257256
};
258257
handlePromiseAfterResult(action,ignored ?ignorePromise :actionPromise());
259258
returnthis;

‎client/packages/lowcoder/src/comps/controls/optionsControl.tsx‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
3838
import{ButtonEventHandlerControl}from"./eventHandlerControl";
3939
import{ControlItemCompBuilder}from"comps/generators/controlCompBuilder";
4040
import{ColorControl}from"./colorControl";
41-
import{reduceInContext}from"../utils/reduceContext";
41+
4242
import{BorderOuterOutlined}from"@ant-design/icons";
4343

4444
// Tag preset color options
@@ -334,14 +334,6 @@ export function mapOptionsControl<T extends OptionsControlType>(
334334
}
335335

336336
overridereduce(action:CompAction){
337-
// TODO: temporary solution condition to fix context issue in dropdown option's events
338-
if(
339-
action.type===CompActionTypes.CUSTOM
340-
&&(action.valueasJSONObject).type==='actionTriggered'
341-
){
342-
constcomp=reduceInContext({inEventContext:true},()=>super.reduce(action));
343-
returncomp;
344-
}else
345337
if(action.type===CompActionTypes.UPDATE_NODES_V2){
346338
constcomp=super.reduce(action)
347339
if(comp.children.data!==this.children.data){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp