As many of you have encountered if you want to select an active item inside a rendered stream, and only that item.
I recently rewrote a LV to use streams instead of an assign, and had the problem when I changed the active item, the previously active would not deselect.
I was looking for a way to resolve this using CSS and came to the following solution.
Maybe you could have a selected property on your item directly and when you select one, you update the previously selected one and the newly selected one with stream_insert?
Add a boolean selected field to your items and add to your markup a checkbox “bound” to the boolean field. When you select an item, do a stream_insert to update your item with selected: true, and another stream_insert to deselect the currently selected field.
It’s a hack. You want to select something but are not using semantic HTML which means it will be awful in terms of accessibility. Selection without elements that can be selected. I’d go as far as using a set of radio buttons, if there can be only one selected item. Maybe even a form.
The radio button may indeed be a cleaner solution. I am not worried about accessibility in this site as it’s an internal tool. Thanks, we live and learn.