From c766528a177842994a172053f013f13dba7b598c Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 3 Apr 2024 09:59:10 -0400 Subject: [PATCH] chore: run build (#29262) I forgot to run the core build in https://github.com/ionic-team/ionic-framework/commit/f726c358682768412aab4d5e1ba23f17c8a52711, so the latest Vue output target wrapper was not generated. --- packages/vue/src/vue-component-lib/utils.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/vue/src/vue-component-lib/utils.ts b/packages/vue/src/vue-component-lib/utils.ts index 136041073e..492ee5d410 100644 --- a/packages/vue/src/vue-component-lib/utils.ts +++ b/packages/vue/src/vue-component-lib/utils.ts @@ -91,8 +91,17 @@ export const defineContainer = ( const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent]; eventsNames.forEach((eventName: string) => { 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); + } }); }); },