fix(ui): keep the voice highlight on layer rows

Toggle the count-line modifier with a directive that leaves other classes alone, so a re-render no longer clears gev-voice-focus.
This commit is contained in:
Sameh Khamis committed 2026-10-30 23:56:20 -07:00
1 parent 231ac4b67b
commit dc9d200725
4 files changed
+65 -4

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
/**
* `v-class-toggle`: toggles each named class with `classList`, so classes other
* code adds to the element (a voice highlight) survive a re-render. A `:class`
* binding rewrites the whole `className` instead.
*/
const apply = (el, { value }) => {
for (const [name, on] of Object.entries(value || {}))
if (el.classList.contains(name) !== Boolean(on))
el.classList.toggle(name, Boolean(on));
};
export const vClassToggle = { mounted: apply, updated: apply };