Skip to content

Commit bac6c00

Browse files
kgogovilhan007
authored andcommitted
fix(ui5-select): add support for Vue.js v-model (#10149)
Enhances the `ui5-select` component to support Vue.js v-model directive by emitting an `input` event when the value changes. Fixes: #9971
1 parent 4c3e290 commit bac6c00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/main/src/Select.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ type SelectLiveChangeEventDetail = {
199199
@event("selected-item-changed", {
200200
bubbles: true,
201201
})
202+
203+
/**
204+
* Fired to make Vue.js two way data binding work properly.
205+
* @private
206+
*/
207+
@event("input", {
208+
bubbles: true,
209+
})
210+
202211
class Select extends UI5Element implements IFormInputElement {
203212
@i18n("@ui5/webcomponents")
204213
static i18nBundle: I18nBundle;
@@ -749,6 +758,9 @@ class Select extends UI5Element implements IFormInputElement {
749758
// Angular two way data binding
750759
this.fireDecoratorEvent("selected-item-changed");
751760

761+
// Fire input event for Vue.js two-way binding
762+
this.fireDecoratorEvent("input");
763+
752764
if (changePrevented) {
753765
this._select(this._selectedIndexBeforeOpen);
754766
}

0 commit comments

Comments
 (0)