kendo-vue icon indicating copy to clipboard operation
kendo-vue copied to clipboard

[Bug][DropDownList] V-model property not updated when onchange event is handled

Open vveesseelliinnaa opened this issue 5 months ago • 0 comments

Describe the bug All components that have both v-model and :change events specified, are not updating the model when the user selects a different item from the list of items.

To Reproduce

  1. Go to https://stackblitz.com/edit/ltezup-e8b2tl?file=src%2Fmain.vue
  2. Click to the first DropDown and select a value
  3. Repeat the step and observe that the value is not updated

Expected behavior Repeat the same steps but with the "Normal Select button" and see that the value is updated on every change.

**Additional details ** Reported in Ticket ID: 1663874

Possible workarounds

Workaround 1

Use the component in controlled mode when the onChange event is handled in order to update its value properly

  • https://stackblitz.com/edit/ltezup-bpnapu?file=src%2Fmain.vue
    onChange: function (e) {
      this.selectedOption = e.sender.value();
    },

Workaround 2

Implement a custom myDropDownList component wrapping the original DropDownList and apply the additional value assigning logic only in it:

  • https://stackblitz.com/edit/ltezup-fv7y8y?file=src%2Fmain.vue,src%2FMyDropDownList.vue

vveesseelliinnaa avatar Sep 12 '24 11:09 vveesseelliinnaa