diff --git a/client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx b/client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx index 73d9d145ab..3882f6b483 100644 --- a/client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx +++ b/client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx @@ -249,11 +249,10 @@ function actionSelectorControl(needContext: boolean) { const condition = this.children.condition.getView(); const ignored = getReduceContext().disableUpdateState || (isConditionSet && !condition); const ignorePromise = Promise.resolve(); - const realNeedContext = needContext || getReduceContext().inEventContext; const actionPromise = () => { - // return realNeedContext ? action.value.func() : this.children.comp.getView()(); - // commenting because it's using old context for event handlers inside list/grid - return this.children.comp.getView()(); + return action.value.context && action.value.func + ? action.value.func() + : this.children.comp.getView()(); }; handlePromiseAfterResult(action, ignored ? ignorePromise : actionPromise()); return this; diff --git a/client/packages/lowcoder/src/comps/controls/optionsControl.tsx b/client/packages/lowcoder/src/comps/controls/optionsControl.tsx index 60f050a8ed..496c7beada 100644 --- a/client/packages/lowcoder/src/comps/controls/optionsControl.tsx +++ b/client/packages/lowcoder/src/comps/controls/optionsControl.tsx @@ -38,7 +38,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes"; import { ButtonEventHandlerControl } from "./eventHandlerControl"; import { ControlItemCompBuilder } from "comps/generators/controlCompBuilder"; import { ColorControl } from "./colorControl"; -import { reduceInContext } from "../utils/reduceContext"; + import { BorderOuterOutlined } from "@ant-design/icons"; // Tag preset color options @@ -334,14 +334,6 @@ export function mapOptionsControl( } override reduce(action: CompAction) { - // TODO: temporary solution condition to fix context issue in dropdown option's events - if ( - action.type === CompActionTypes.CUSTOM - && (action.value as JSONObject).type === 'actionTriggered' - ) { - const comp = reduceInContext({ inEventContext: true }, () => super.reduce(action)); - return comp; - } else if (action.type === CompActionTypes.UPDATE_NODES_V2) { const comp = super.reduce(action) if (comp.children.data !== this.children.data) {