vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.75k stars 8.34k forks source link

`update:modelValue` not triggered when `modelValue` is an object #12430

Closed jonas-eiselt-fk closed 4 days ago

jonas-eiselt-fk commented 4 days ago

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNqFU01v1DAQ/SsjX9pVtwlo4bJkKz7UA0gUBIWTJRSSSXBxbOOPsFKU/87YISFI2/YWz5s3eW/8PLBXxmR9QLZnhausMB4c+mCuuBKd0dbDABYbGKGxuoMzaj1boDe6M1OdsyyPpziKM664qrRyHjpdo4RDHHE+QCOs8zdlh3sicLYFWa7PMG5mXqWD8mj/Mp9sXsSRTVCVF1qBVu/j3C+mLj2eb2DgCmZK1pcy4MUFMUauinwyRXbo4LEzkih0AijM1a3o0MHLkObsk9bLRAdvRduixXoPw7CoGccij5tJ5CQhwZPJFVjFvaznHThLJ/J44m+E/ueIunIaVOQrvWzLvKPdNKLN7pxWdF/JNWfxZ0Ki/WDibhxnpCkiESul1L/fpZq3AbdzvfqB1c8T9Tt3jDXOPlp0aHuSsmC+tC36Cb7+fINH+l5AchMkdT8AfkKnZYgap7bXQdUke9WX1L5N0RKqvXXXR4/Kzaai0Ng5pn7OKGkxcfdZ/yd3lz1LPAoEbXFO6YnAryL7NaXgADU2QmG6G8qvxV9BpFBEMRRXCtlDCRPKBA/9ZRo5ZyCNzpankC67+G4fZcxv5Z50fOvRxl2Rr132PHu6Y+MfMHFQgw==

Steps to reproduce

  1. Open provided Playground example
  2. Enter "foo" in first field
  3. The counter doesn't update because update:modelValue hasn't been triggered (see image below) image

What is expected?

  1. Open another Playground example: https://play.vuejs.org/#eNp9Ustu3DAM/BVCl91FErtt2svWCfpADi3QB9q0JwHFwqZdpbak6uEsYPjfQ8rxxgE2uZkccjxDzSDeW5v1EcVWFL50ygbwGKK9lFp11rgAAzisYYTamQ5WNLo6QB9NZ6e+FFnOFVNJIbXUpdE+QGcqbOGCKdarZrWZ+6WJOqC7R15s3vJKHXUZlNFg9Bfe+2WrXcA1bmCQGuadrN+1EU9OaAUm/qlDXEi9Ueoin5yQByoCdrYlHqoACnt5rTr08C4m8m0iOJsIglNNgw6rLQzDQeI4FjmfIy0nXQmenC3Ako+x5LuQIlVSHPsboY9s0lROREW+0CtORfB0sFo12Y03mh4pXUIK/plq0X2zfDAvBWlihLFd25rbz6kXXMTTuV/+xfLfkf6N33NPiu8OPbqepBywsHMNhgm++vkV9/R9AMlNbGn6GfAHetNG1jiNfYi6ItmLuaT2U8qT0s21v9oH1H42xUJ5ckzzUlC8OGZPWX+Qe569TnsUCLriHM0jKV/k9Pd9jCqslcb0NmtO//+oUihYDIyc1ecSprSNAfqzRDlnIFE/8cR/enRsmMSdZ2+yl6/EeAcYozhr
  2. Enter "foo" in example's only field
  3. The counter updates! update:modelValue has been triggered image

What is actually happening?

I don't know... the non-working example uses an object as the model-value whereas the working example uses a string as the model-value.

System Info

No response

Any additional comments?

No response

jacekkarczmarczyk commented 4 days ago

Please check existing issues https://github.com/vuejs/core/issues?q=is%3Aissue+defineModel+object+is%3Aclosed

edison1105 commented 4 days ago

duplicate of #12261 see https://github.com/vuejs/core/issues/12261#issuecomment-2440005882