Skip to content

Commit 21c5b4a

Browse files
committed
chore(deps): update vue output target
1 parent 366f468 commit 21c5b4a

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

core/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@stencil/angular-output-target": "^0.8.4",
5151
"@stencil/react-output-target": "^0.5.3",
5252
"@stencil/sass": "^3.0.9",
53-
"@stencil/vue-output-target": "^0.8.7",
53+
"@stencil/vue-output-target": "^0.0.1-dev.11722540458.1506f4d7",
5454
"@types/jest": "^29.5.6",
5555
"@types/node": "^14.6.0",
5656
"@typescript-eslint/eslint-plugin": "^6.7.2",

packages/vue/src/vue-component-lib/utils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,17 @@ export const defineContainer = <Props, VModelType = string | number | boolean>(
9191
const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
9292
eventsNames.forEach((eventName: string) => {
9393
el.addEventListener(eventName.toLowerCase(), (e: Event) => {
94-
modelPropValue = (e?.target as any)[modelProp];
95-
emit(UPDATE_VALUE_EVENT, modelPropValue);
94+
/**
95+
* Only update the v-model binding if the event's target is the element we are
96+
* listening on. For example, Component A could emit ionChange, but it could also
97+
* have a descendant Component B that also emits ionChange. We only want to update
98+
* the v-model for Component A when ionChange originates from that element and not
99+
* when ionChange bubbles up from Component B.
100+
*/
101+
if (e.target.tagName === el.tagName) {
102+
modelPropValue = (e?.target as any)[modelProp];
103+
emit(UPDATE_VALUE_EVENT, modelPropValue);
104+
}
96105
});
97106
});
98107
},

0 commit comments

Comments
 (0)