fix(csr): prevent native output recursion
This commit is contained in:
@@ -2512,6 +2512,11 @@ export const REACTIVE_RUNTIME = String.raw`
|
||||
|
||||
var stmt = attr.value;
|
||||
var listener = function (event) {
|
||||
// An unbound output falls back to a same-named CustomEvent for
|
||||
// external consumers. Do not feed that synthetic event back into
|
||||
// the component's own declarative DOM handler (for example,
|
||||
// @click="output.click()"), which would recurse indefinitely.
|
||||
if (event && event.__wrnexusComponentOutput) return;
|
||||
var locals =
|
||||
decodeLoopLocals(node);
|
||||
|
||||
@@ -4167,6 +4172,7 @@ export const REACTIVE_RUNTIME = String.raw`
|
||||
bubbles: true,
|
||||
detail: detail || {},
|
||||
});
|
||||
event.__wrnexusComponentOutput = true;
|
||||
root.dispatchEvent(event);
|
||||
// Compatibility for applications using the former prefixed contract.
|
||||
root.dispatchEvent(new EventConstructor("wrnexus:" + String(name), {
|
||||
|
||||
Reference in New Issue
Block a user