Skip to content

Commit 5fced88

Browse files
jasonvargaclaude
andcommitted
don't remount the virtualizer on every selection change
ComboboxVirtualizer was keyed on JSON.stringify(modelValue), which forced a full destroy + remount of the virtualizer (and every rendered row) on every selection toggle. In a long multi-select dropdown this threw away the user's scroll position on each click and re-ran all the row mounting work, plus the JSON.stringify itself. The key isn't needed: row selected styling comes from :class="itemClasses({ selected: isSelected(option) })", which is already reactive on modelValue, so individual rows re-style themselves without needing the virtualizer to remount. Verified that both selecting and deselecting a row in a multi-select with 20 options updates the blue selected styling and preserves scroll position. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2eed55a commit 5fced88

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

resources/js/components/ui/Combobox/Combobox.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ defineExpose({
476476
477477
<ComboboxVirtualizer
478478
v-if="filteredOptions.length"
479-
:key="JSON.stringify(modelValue)"
480479
:estimate-size="40"
481480
:options="filteredOptions"
482481
:text-content="(opt) => getOptionLabel(opt)"

0 commit comments

Comments
 (0)