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
Closed
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

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 1, 2024
ujshaikh pushed a commit to ujshaikh/primereact that referenced this issue May 4, 2024
nitrogenous added a commit that referenced this issue May 13, 2024
Fix #6522: Minus sign after all selection - InputNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants