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

deleting negative sign with backspace also deletes the last digit #597

Closed
1 task done
dimitri-HR opened this issue Nov 26, 2021 · 0 comments
Closed
1 task done

Comments

@dimitri-HR
Copy link

Describe the issue and the actual behavior

When trying to delete the minus sign '-' with a backspace, the last digit is also removed
Affects inputs with prefixes.

Describe the expected behavior

Only the negative sign should be removed

Provide a CodeSandbox link illustrating the issue

happens even on the official demo site
https://jinno.io/app/23/isAllowed?source=react-number-format&displayType=input

Provide steps to reproduce this issue

have an input field with the prefix (e.g $)
type a negative number, e.g. -123
you will see something like this: -$123
move cursor left to the front, e.g. before '123'
press backspace on the keyboard to delete the negative sign

The result: negative sign is removed but also the last digit is removed (e.g. $12) and the cursor is moved to the end

Please check the browsers where the issue is seen

  • Chrome
s-yadav added a commit that referenced this issue Nov 30, 2021
s-yadav added a commit that referenced this issue Dec 1, 2021
@s-yadav s-yadav closed this as completed in 3f3935e Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant