Skip to content

fix(elastic-slider): drag handle teleporting to the label end#109

Merged
Vijayabaskar56 merged 1 commit into
mainfrom
dev
Jun 12, 2026
Merged

fix(elastic-slider): drag handle teleporting to the label end#109
Vijayabaskar56 merged 1 commit into
mainfrom
dev

Conversation

@Vijayabaskar56

Copy link
Copy Markdown
Member

Problem

On the customize-sidebar slider rows, grabbing the handle at a low value teleported the value toward the middle of the range ("snaps to the closest point next to the end of the label text").

Root cause: the fill tile had a min-width clamp (label end + 24px — "tile never collapses behind the label") so the handle rendered at the end of the label text, while the pointer→value mapping stayed full-track linear. Visual position and value disagreed, so grabbing the handle where you see it jumped the value.

Fix

Adopt the upstream @ncdai/elastic-slider interaction model: fill width ≡ value percent, no clamp — render position always equals value position, so drag is 1:1 with the cursor.

  • Fill may now collapse behind the label; the handle fades there instead (upstream's two-sided label/value dodge)
  • Keeps the Figma styling (gray tile, hash/dot marks, 2×12 handle), the allowAuto left slot, dot snap stops, and endIcon

Verification

  • Measured during paced drags: fill edge tracks the cursor exactly at low/mid/high positions; handle dodge opacities correct
  • tsc, oxlint, oxfmt, vitest, knip all green (pre-commit + pre-push hooks)

The fill tile's min-width clamp (label end + 24px, "tile never collapses
behind the label") made the handle RENDER at the end of the label text at
low values while the pointer→value mapping stayed full-track linear — so
grabbing the handle where you see it teleported the value to ~the middle
of the range.

Adopt the upstream @ncdai/elastic-slider model: fill width ≡ value percent,
no clamp, render position always equals value position. The fill may now
collapse behind the label; the handle fades there instead (upstream's
two-sided label/value dodge). Keeps the Figma styling, the allowAuto left
slot, dot snap stops, and endIcon.
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
reform Building Building Preview, Comment Jun 12, 2026 6:39pm

Request Review

@Vijayabaskar56
Vijayabaskar56 merged commit bed6b12 into main Jun 12, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant