Skip to content

Conversation

@taylorjdawson
Copy link
Collaborator

@taylorjdawson taylorjdawson commented Sep 12, 2025

Improve ValueInput: strict decimal sanitizer, UX tweaks, and blur coercion

  • What: Ensures only valid decimal values can be entered while keeping smooth typing UX.

  • How:

    • Added a small sanitizer used on change:
      • Strict dot-only (commas removed)
      • Single decimal point (extra dots dropped)
      • Leading-zero normalization (.50.5, 0001212, 00.50.5)
      • Caps fractional part at 10 decimals
    • Allowed 1. as a typing state; on blur it becomes 1 (also .0).
    • Removed unnecessary event suppression in onChange.
    • Input UX: inputMode="decimal", autoComplete="off", spellCheck={false}, added aria-label.
    • Minor className ordering tidy-ups.
  • Before: Allowed ..., 0...., 1..2, 0.0.0. and other invalid strings.

  • After: Those inputs are sanitized to valid forms (e.g., 1..21.2, ...0. while typing, 0 on blur).

No visual layout changes; scaling/width logic unchanged.

@vercel
Copy link

vercel bot commented Sep 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
demo-embedded-wallet Ready Ready Preview Comment Sep 12, 2025 6:08pm

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