`ContentToc` highlight indicator wobbles on its far edge while the page scrolls
Environment
- Operating System:
Darwin 26.5.2 - Node Version:
v24.21.0 - Nuxt Version:
4.6.2 - Package Manager:
[email protected] - @nuxt/ui:
4.12.0
Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
v4.12.0
Reproduction
No setup needed, the docs site already renders this component with 18 headings: https://ui.nuxt.com/docs/getting-started/installation/nuxt
Scroll slowly and watch the highlight bar next to the table of contents.
If you prefer the playground, this reproduces it in about 35 lines:
<template>
<div class="flex gap-8">
<div class="flex-1 space-y-[18vh]">
<h2 v-for="link in links" :id="link.id" :key="link.id">
{{ link.text }}
</h2>
</div>
<UContentToc highlight highlight-variant="circuit" :links="links" class="h-96" />
</div>
</template>
Description
The highlight indicator moves both of its edges on every scrollspy change. With three active headings (A, B, C) scrolling to two (B, C) should only move the top edge, but the bottom edge shakes back and forth for the whole transition.
Expected: the edge whose value did not change stays still.
Actual: both edges move, so the bar wobbles while the page scrolls.
What it's like on the doc site
The theme animates the offset and the size together, translate-y-(--indicator-position) and h-(--indicator-size) with transition-[translate,height]. translate is composited while height is not, so during a scroll the two advance at different rates and their sum stops being constant.
I have a fix ready and will open a PR.
Additional context
No response
Logs