Fix typed priority

commit_hash:3160ad9b7c0274d8e64a3ae0ded642aa2413dc2c
This commit is contained in:
4eb0da
2025-06-03 10:55:46 +03:00
parent d56d50116d
commit e46a540df6
3 changed files with 65 additions and 3 deletions
+1
View File
@@ -20660,6 +20660,7 @@
"test_data/integration_test_data/local_functions_string.json":"divkit/public/test_data/integration_test_data/local_functions_string.json",
"test_data/integration_test_data/local_functions_url.json":"divkit/public/test_data/integration_test_data/local_functions_url.json",
"test_data/integration_test_data/set_dict_variable.json":"divkit/public/test_data/integration_test_data/set_dict_variable.json",
"test_data/integration_test_data/typed_action_priority.json":"divkit/public/test_data/integration_test_data/typed_action_priority.json",
"test_data/interactive_snapshot_test_data/div-action/array-variable-mutation.json":"divkit/public/test_data/interactive_snapshot_test_data/div-action/array-variable-mutation.json",
"test_data/interactive_snapshot_test_data/div-action/base.json":"divkit/public/test_data/interactive_snapshot_test_data/div-action/base.json",
"test_data/interactive_snapshot_test_data/div-action/focus-actions.json":"divkit/public/test_data/interactive_snapshot_test_data/div-action/focus-actions.json",
+3 -3
View File
@@ -1490,7 +1490,9 @@
const actionUrl = action.url;
const actionTyped = action.typed;
if (actionUrl) {
if (actionTyped) {
await execActionInternal(action, filtered[i], opts.componentContext);
} else if (actionUrl) {
const schema = getUrlSchema(actionUrl);
if (schema) {
if (isBuiltinSchema(schema, builtinSet)) {
@@ -1513,8 +1515,6 @@
await tick();
}
}
} else if (actionTyped) {
await execActionInternal(action, filtered[i], opts.componentContext);
} else if (opts.node && Array.isArray(action.menu_items) && action.menu_items.length) {
menu = {
items: action.menu_items,
@@ -0,0 +1,61 @@
{
"description": "typed part of the action should be more important, than the url.",
"div_data": {
"card": {
"log_id": "a",
"variables": [{
"name": "val",
"type": "string",
"value": ""
}],
"variable_triggers": [{
"condition": "@{val == 'run'}",
"actions": [{
"log_id": "a",
"url": "unknown://",
"typed": {
"type": "set_variable",
"variable_name": "val",
"value": {
"type": "string",
"value": "triggered"
}
}
}]
}],
"states": [{
"state_id": 0,
"div": {
"type": "text",
"text": "Hello @{val}",
"font_size": 32
}
}]
}
},
"cases": [
{
"div_actions": [
{
"log_id": "run trigger",
"url": "div-action://set_variable?name=val&value=run"
}
],
"expected": [
{
"type": "variable",
"variable_name": "val",
"value": {
"type": "string",
"value": "triggered"
}
}
],
"platforms": [
"android",
"ios",
"web"
]
}
]
}