Commit 5fced88
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | 479 | | |
481 | 480 | | |
482 | 481 | | |
| |||
0 commit comments