I have a v-list-item-group
with some v-list-item
's inside with an associated value
. The problem is that when I change the value
of the selected v-list-item
it doesn't react. I want it to be selected only when the new value
matches the v-list-item-group
's model and be unselected otherwise. What is the best way to achieve such a behaviour?
Example. When you edit the list item value, for example, by changing the lower left field from "Bluetooth" to "Bluetooth1", I want the list item to get deselected automatically because its value
isn't longer matching v-list-item-group
's model
("Bluetooth1" != "Bluetooth"). And when you change it back to "Bluetooth" I want it to get selected again.
The one on the right modifies the v-list-item-group
's model and this works as expected.
My actual use case is rendering lists of thousands of elements quickly without rendering them all. To achieve it I use a recycle-scroller component inside my v-list-item-group
to manage its items. It creates a few dozens of v-list-item
s and as user scrolls it reuses them by moving them around and replacing their value, icon and text with corresponding data from my array. The problem is that when user selects some list item then scrolls the list, the selected item gets reused. Despite the fact that it now has a different value, text and icon it still looks as selected. So they see it as if some different item was selected.
v-list-item-group
, tbh the documentation doesn't give me much options. Can you tell me more about your use case ? Maybe it's easier with another component ? – Pascal Lamersv-list-item-group
component, I probably would go with the first option, to keep the initial selection while scrolling - That's something I can work with :) I ll let you know – Pascal Lamers