Skip to content

NumberInput: Deleting One Digit from Certain Decimals Unexpectedly Truncates to Integer Value #8089

@julihereu

Description

@julihereu

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

8.1.3

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

When using the NumberInput component, deleting a single digit from certain decimal numbers using the backspace key results in the entire decimal portion being truncated, leaving only the integer value. The problem seems to occur specifically when there are trailing zeros after the decimal and the last nonzero digit is deleted, e.g.:

  • for 1.09 you get 1
  • for 1.00 you get 1.0
  • for 1.11 you get 1.1

It can be easily reproduced using the demo of the NumberInput on the mantine website.

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedCompleted issues that will be published with next patch (1.0.X)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions