Skip to content

si-number-input with step="1" does not prevent typing decimal numbers #2558

Description

@bm-77

When using si-number-input with [step]="1" (either explicitly or relying on the default), users can still type decimal numbers directly into the input field. The step constraint is only enforced on the stepper buttons and is not reflected in keyboard input filtering.

Steps to reproduce:

  • Render <si-number-input [min]="1" [max]="100" [step]="1" [showButtons]="true" />
  • Click into the input field
  • Type 2.5 using the keyboard

Expected: The decimal point character should be rejected. The API could expose an input property for restricting keyboard input to integers (e.g. allowDecimal)

Actual: 2.5 is accepted as input. The value accessor emits 2.5 to the form control, which can cause unexpected behavior.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions