vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.7.0] v-chip retains wrong css class 'v-chip--selected' when v-model is false

Open mahi-intersoft opened this issue 1 year ago • 1 comments

Environment

Vuetify Version: 3.7.0 Vue Version: 3.4.30 Browsers: Firefox 129.0 OS: Windows

Steps to reproduce

  1. Klick the Select Button (all two items should be selected and the Select Button changes to Un-Select )
  2. Un-Select one item manually
  3. The Un-Select Button will change back to Select but retains the css class 'v-chip--selected' which makes the backround slighly colored.

Expected Behavior

No background color changes are retained when switching the v-model state.

Actual Behavior

'v-chip--selected' is set so the backgorund is colored even when the chip is not selected

Reproduction Link

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

Other comments

I hope this is not an error on my side, my thought process is: v-model is the de facto singel source of truth if the chip is selected or not and 'v-chip--selected' as css class when being selected seems off to me.

mahi-intersoft avatar Aug 21 '24 12:08 mahi-intersoft

1 2 3 4

mahi-intersoft avatar Aug 21 '24 12:08 mahi-intersoft

This would be easier if VChip supported the active property, but my suggestion is to control the VChipGroup model or use a VBtn:

https://play.vuetifyjs.com/#eNqtVm1v0zAQ/itWJLQhLS1tBxKh5VVDgg+AePmA1n3wnEtrcO3IPmeFaf+dy+vcNKuGQJpW557z3fNczuecX0fOivGrPB8VHqIkmiNscsURni81Y/MiFmuZxytrfF4aGEs2JgUVF1x5WCwjBwoEQvoVHAruwI0U6BWu2WKxYEo6/JidbUF4lEZ32At2/uiCJUx7pZZRHVco7hwF3GA8rW0VA+KQyqJZdoTaR8aKWGa0K5MKwY74bbydmDaestxITT4h7vCXKkUIo4xNGAJXz1hmNMZXIFdrTNilUWm4o+BWco20x3hUUsMO+lIoKX52VXkVsukkMPZNx18qh07VuJZ1SCYoB/+k7L/LOKhhPm5fWwvUTUSmprFSjjxGfqkaWUVcddZQT7XpE0ndWcruN1a/iShAwUsknrRQCtpJ/FXVZJNzIt4AZcyunZFSar6BFnRrcxXXfErDmOjPx8ERoUcnrMyxkgrb3FikVBn3Ctl1k5mEHj9snxizgN7q22fG6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bXWRK9ORxmNFBAHqr7+Zsp28WmxgjtTNWcOXgNDYXXCrIhxDBtQB1D6gNfvF6CLFea6lXQ5DzQoBzhR9gchuNc3ICiy5jP+Ple+kQBdKVCuadNX9Bsx9m5S2O9uI1OVBlS6Cdpk+f97CCY8aejZ8cLLGX5D8769kraxAkpXx2sERaQ/bR9FE//Ep5hEGVCKMLVBGvPXOswq9ofFDCJE2M9wv4uHKhKolzM5xOZ/M+c4ccfSNbP1WqhmdPz6bT+3k/JNx0PpvP/jfm7CFa7dpGAK84inV0Ew6EjG8SUV1LN47a0yIO2IJHe3LrcV9jDgR3zMJvCbg2OaXd40j9c5+bLNhJj98efh9BtqBaOXCLk9zWZ3QXGdD8gXsP51zy6qR3itTm2OJF+zvu+mLk8vg4R7Q+pjgsJ5nPJ10HTU4TdMLoQq7Gv53R9FS3OW17NvU9+6na9ftO/mVC4czVh9bWxNztT2vWIP4M2H+7TWNbJp8tUNuqqdl3GHK7AnoaGvji60fY0LgD6X3y9FodA7+AM9RDiOPW7Q29uUQ78mvZvi+bh4K67jd3saGO40JSQbStOsuE/q+8PZL6Hd35eL7Tkz7J7an2SrVfv/4BZ3ed9A==

Thank you for your contribution and interest in improving Vuetify! Make sure to join us in the Discord community.

johnleider avatar Feb 04 '25 18:02 johnleider

@johnleider Thank you for your time and work!

We will use buttons in that case. The Example I built here is rather simple, in reality I use several chips in the group with different rules, therefore I cannot use the suggestion to control the VChipGroup model easily, but buttons should work just fine.

mahi-intersoft avatar Feb 05 '25 10:02 mahi-intersoft