Skip to content

fix(timepicker): hold typed and stepped times inside minValue/maxValue - #132

Merged
Agustin-Delgado merged 1 commit into
mainfrom
fix/timepicker-clamp-to-range
Oct 21, 2026
Merged

Agustin-Delgado merged 1 commit into
mainfrom
fix/timepicker-clamp-to-range

Conversation

@Agustin-Delgado

Copy link
Copy Markdown
Collaborator

What

The TimePicker let a typed time go past minValue/maxValue: it drew it in red and committed null. The arrows also walked past the bounds.

Now the draft is held inside the range as it changes:

  • Arrows stop at the min and the max.
  • A typed time past the max becomes the max (and one before the min, the min) at once, not on blur.
  • A first digit still waiting for its pair (1 on the way to 19 under a 10:00 min) is not clamped yet; it is held once completed or when its segment is left. Backspace behaves the same way.

The wheels already disabled out-of-range options; they are unchanged.

Tests

Replaced the "flags invalid when out of range" case with clamp cases (typed, pending digit, arrows at min and max). vitest timepicker + clock: 204 passing. svelte-check: 0 errors.

🤖 Generated with Claude Code

A time past the max becomes the max and one before the min becomes the min, as it changes, instead of being left invalid. A first digit waiting for its pair is held once it is completed or its segment is left.
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
human-kit-ui-docs Ready Ready Preview Oct 20, 2026 5:04pm UTC

@Agustin-Delgado
Agustin-Delgado merged commit b539fcd into main Oct 21, 2026
19 of 23 checks passed

This branch was successfully deployed

1 active deployment
Preview — 6f330414 Deployed Oct 20, 2026 by vercel[bot]
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