vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.86k stars 6.97k forks source link

[Bug Report][3.7.2] Group Item with value of null is replaced with index for vmodel #20550

Open ttonyh opened 1 month ago

ttonyh commented 1 month ago

Environment

Vuetify Version: 3.7.2 Vue Version: 3.5.10 Browsers: Firefox 130.0, Google Chrome, Microsoft Edge, Safari, Mozilla Firefox OS: Linux x86_64

Steps to reproduce

In the reproduction link:

  1. Select an item in the VSelect box
  2. You should see the same item selected in the VItemGroup
  3. Clear the value in the VSelect box using the "clearable" button

Expected Behavior

I would expect that the VListItem with the value of null be selected.

Actual Behavior

No VListItem is selected because none match what VSelect updated the model to, which is null.

Reproduction Link

https://play.vuetifyjs.com/#...

ttonyh commented 1 month ago

I suspect the issue is by checking if the item value is nullish (below) instead of undefined: https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/group.ts#L358

KaelWD commented 1 month ago

You shouldn't need the item-group either: https://play.vuetifyjs.com/#eNrlVEtr3DAQ/iuDe9gWopiWnsxmodAeCn0cCr3EoSj2bFCRZSHJpsH4v3dGfsnbB6XXXCzrm/c3o7kdMu+q/I21132HWZEdAzZWy4Cn0gAceyGtjb/xUrUmSGXQzRCB9vTx89t3HwoYBmjaGjWM4zFnm1WlF7XqVY0OKi29vymz5lG8LjPI91oeNVZhAQB6ER2yPp9ltokKRXmyp3imEovOKx/QBFFplG6TxKu817hBbC2CChrJVcAfIfUUhb3UHQtVnYochs4Z0d5/TxI+HfOlhv+pXlPWW4QajVfhkbSrtrGSoiThZ2KKKRjWv2NokgkfHDXzgR15ZR40CmLhvCmujVxzEFw3hTi3buYXlIlkEM9QrIQQUGaJOTlYZgeeWYcWDSc2gPJf5jxhvLDYBxVUpmoN+CAdU5jqRU0na9VCEWvdOrO6J+fcgqh1GYbwyzj73PPd4K8w9e5Ek81m1zwgcboZTHhLff+Jz5U302nq05Pg7VMLXzkYPOeiX/wbbwu6LB267rcOI9NS2sWmq6+csoEmP3TTzlKNbV2Agd7rGUY4u7aBA+25w/TwyK8P89K6YZ0pz1QYx56Et1M2w5Klqgs4qPrby8PVAvF0EPgeJD0YbvkqG+fzF+tXf7FeZZP1HZc7FUilZeMVpxo/dz8BooO7gg==