Skip to content

type() truncates numbers before the decimal point for number inputs #886

@tbertrand7

Description

@tbertrand7

Reproduction example

https://codesandbox.io/s/stoic-snow-vcz5kz

Prerequisites

  1. Render an input with type="number"
  2. Execute type() on the number input with a decimal value (ex. await user.type(screen.getByTestId('input'), '12.55'))

Expected behavior

12.55 is typed into the number input.

Actual behavior

The numbers before the decimal point are truncated and 55 is typed into the number input.

User-event version

14.0.0

Environment

Testing Library framework:

JS framework:

Test environment:

DOM implementation:

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions