Subscribe on changes!

[BUG] "change" event won't be dispatched when binding to checkbox elements

avatar
Jun 11th 2021

Version

3.1.1

Reproduction link

https://codesandbox.io/s/little-night-x81gn?file=/src/App.vue

Steps to reproduce

  1. check any of the checkboxes
  2. click "clear all"
  3. check the console, confirm that "changed" has not been logged.

What is expected?

"changed" should be logged, because the value of the bound input element has been changed.

avatar
Jun 11th 2021

It is expected. You don't get the change event when programmatically changing the values of checkboxes. You only get it after user interaction.

avatar
Jun 11th 2021

@Justineo thanks for replying! I didn't expect that, so what would be the workaround for my usecase?

avatar
Jun 11th 2021
watch(checked, ()=>console.log("changed"))