Skip to content

Commit c766528

Browse files
authored
chore: run build (#29262)
I forgot to run the core build in f726c35, so the latest Vue output target wrapper was not generated.
1 parent 9b3cf9f commit c766528

File tree

1 file changed

+11
-2
lines changed
  • packages/vue/src/vue-component-lib

1 file changed

+11
-2
lines changed

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)