Skip to content

1.3.2 Input validation: only allow decimal values (example regex: ^(0|[1-9]\d*)(\.\d+)?$) #8

Closed

Description

@Boxuan-Matty-Lin

Background

Currently the user can type any characters into the amount input field, which may lead to unexpected display issues.

Goal

Restrict the input so that only valid numeric decimal values are allowed. When the user attempts to enter invalid characters, show a gentle inline warning.

Definition of Done

  • The field accepts only decimal numbers (example regex: ^(0|[1-9]\d*)(\.\d+)?$). Scientific notation is not allowed.
  • Invalid characters are blocked on type and on paste, including IME input cases.
  • A gentle inline hint appears when input is invalid. No modal is used.
  • The component preserves caret position and common editing keys continue to work.
  • Screen reader users are informed via an inline, aria-live announcement.
  • Unit tests cover valid and invalid cases, typing, pasting, and hint visibility.
  • README is updated under “Validation & Precision” to document the rules.

Activity

  1. changed the title [-]Input validation: only allow decimal values (example regex: `^(0|[1-9]\d*)(\.\d+)?$`)[/-] [+]1.3.2 Input validation: only allow decimal values (example regex: `^(0|[1-9]\d*)(\.\d+)?$`)[/+] on Oct 28, 2025
  2. Boxuan-Matty-Lin commented on Oct 29, 2025

    @Boxuan-Matty-Lin
    OwnerAuthor

    after typing 'r' , it shows
    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions