diff --git a/packages/doenetml/src/Core/Core.js b/packages/doenetml/src/Core/Core.js index 6f1b26670..b1d708526 100644 --- a/packages/doenetml/src/Core/Core.js +++ b/packages/doenetml/src/Core/Core.js @@ -10697,22 +10697,20 @@ export default class Core { actionsToChain.push(...this.actionsChangedToActions[id]); } - if (comp?.shadows) { - if ( - ["focus", "click"].includes(triggeringAction) && - cName.substring(0, 3) !== "/__" - ) { - // for focus and click, we propagate to shadows only if - // the copied component doesn't have a name. - // In this way, if we include $P in a graph, - // then triggerWhenObjectsClicked="P" and triggerWhenObjectsFocused="P" - // will be triggered by that copy, - // but these actions will not be triggered if that copy has a name. - // TODO: if no longer has a name like "_point1", - // should triggerWhenObjectsClicked="P" be triggered from that point? - // Currently, it is not triggered. - break; - } + if ( + comp?.shadows && + ["focus", "click"].includes(triggeringAction) && + cName.substring(0, 3) === "/__" + ) { + // for focus and click, we propagate to shadows only if + // the copied component doesn't have a name. + // In this way, if we include $P in a graph, + // then triggerWhenObjectsClicked="P" and triggerWhenObjectsFocused="P" + // will be triggered by that copy, + // but these actions will not be triggered if that copy has a name. + // TODO: if no longer has a name like "_point1", + // should triggerWhenObjectsClicked="P" be triggered from that point? + // Currently, it is not triggered. cName = comp.shadows.componentName; } else { break; diff --git a/packages/test-cypress/cypress/e2e/tagSpecific/updatevalue.cy.js b/packages/test-cypress/cypress/e2e/tagSpecific/updatevalue.cy.js index 36f0fc380..c5a137fa7 100644 --- a/packages/test-cypress/cypress/e2e/tagSpecific/updatevalue.cy.js +++ b/packages/test-cypress/cypress/e2e/tagSpecific/updatevalue.cy.js @@ -1207,7 +1207,7 @@ describe("UpdateValue Tag Tests", function () { }); }); - it("chained updates, copies copy triggers", () => { + it("chained updates, copies don't copy triggers", () => { cy.window().then(async (win) => { win.postMessage( { @@ -1240,17 +1240,17 @@ describe("UpdateValue Tag Tests", function () { cy.get(cesc2("#/uv2")).click(); cy.get(cesc2("#/n")).should("have.text", "3"); - cy.get(cesc2("#/m1")).should("have.text", "3"); + cy.get(cesc2("#/m1")).should("have.text", "2"); cy.get(cesc2("#/m2")).should("have.text", "2"); cy.get(cesc2("#/uv3")).click(); cy.get(cesc2("#/n")).should("have.text", "4"); - cy.get(cesc2("#/m1")).should("have.text", "4"); + cy.get(cesc2("#/m1")).should("have.text", "2"); cy.get(cesc2("#/m2")).should("have.text", "2"); cy.get(cesc2("#/pmacro") + " button").click(); cy.get(cesc2("#/n")).should("have.text", "5"); - cy.get(cesc2("#/m1")).should("have.text", "5"); + cy.get(cesc2("#/m1")).should("have.text", "2"); cy.get(cesc2("#/m2")).should("have.text", "2"); });