Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputNumber: Selected negative value can't be overwritten with a minus ('-') symbol #6522

Closed
Kropik123 opened this issue Apr 30, 2024 · 1 comment · Fixed by #6566, leoo1992/GeradorQRCode#40, mtech-31-quemistry/quemistry_client_web#3 or leoo1992/GeradorQRCode#57 · May be fixed by nhattpn/BTL_LTNC#56
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@Kropik123
Copy link

Kropik123 commented Apr 30, 2024

Describe the bug

When there is already a '-' entered into an InputNumber component it correctly does not allow adding another '-'.
However this currently also applies when you want to replace a selected value.
It is rather easy to go around this issue with pressing the 'backspace' key first to clear the value but it adds some inconvenience for the user when replacing negative values.

Reproducer

https://primereact.org/inputnumber/

PrimeReact version

10.6.4

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to https://primereact.org/inputnumber/
  2. Enter "-100" in the first rendered InputNumber (with text "Integer only")
  3. Select the "-100"
  4. Press the '-' key again
  5. Nothing happens

image

Expected behavior

When selecting the whole value together with the '-' and then pressing the key '-', I would expect everything to be replaced with a single '-'.

@Kropik123 Kropik123 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 30, 2024
@ujshaikh
Copy link
Contributor

ujshaikh commented May 1, 2024

@melloware
I want to fix this one

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