@stencil/vue-output-target
Advanced tools
Comparing version 0.0.1-dev.11705624885.1949250b to 0.0.1-dev.11711372539.10de27e3
{ | ||
"name": "@stencil/vue-output-target", | ||
"version": "0.0.1-dev.11705624885.1949250b", | ||
"version": "0.0.1-dev.11711372539.10de27e3", | ||
"description": "Vue output target for @stencil/core components.", | ||
@@ -55,3 +55,3 @@ "main": "dist/index.cjs.js", | ||
}, | ||
"gitHead": "949250bca27baea1a72d2e014b218c359d5a17a4", | ||
"gitHead": "0de27e325f2697a448cc8b3eb7495e814fe540cd", | ||
"volta": { | ||
@@ -58,0 +58,0 @@ "extends": "../../package.json" |
@@ -94,4 +94,13 @@ // @ts-nocheck | ||
el.addEventListener(eventName.toLowerCase(), (e: Event) => { | ||
modelPropValue = (e?.target as any)[modelProp]; | ||
emit(UPDATE_VALUE_EVENT, modelPropValue); | ||
/** | ||
* Only update the v-model binding if the event's target is the element we are | ||
* listening on. For example, Component A could emit ionChange, but it could also | ||
* have a descendant Component B that also emits ionChange. We only want to update | ||
* the v-model for Component A when ionChange originates from that element and not | ||
* when ionChange bubbles up from Component B. | ||
*/ | ||
if (e.target.tagName === el.tagName) { | ||
modelPropValue = (e?.target as any)[modelProp]; | ||
emit(UPDATE_VALUE_EVENT, modelPropValue); | ||
} | ||
}); | ||
@@ -98,0 +107,0 @@ }); |
54812
996