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

[Fix]: #1970, #1984 event handler context#2006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 = () => {
//returnrealNeedContext ?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;
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand DownExpand Up@@ -334,14 +334,6 @@ export function mapOptionsControl<T extends OptionsControlType>(
}

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) {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp