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

Cursor jumps after decimal separator if thousand separator should disappear #695

Closed
4 tasks
rene-stesl opened this issue Oct 24, 2022 · 3 comments
Closed
4 tasks

Comments

@rene-stesl
Copy link

Describe the issue and the actual behavior

Starting point is a NumericFormat which has multiple thousandSeparators and a decimalSeparator.
If the cursor is placed right in front of the decimal separator and backspace is pressed, the cursor jumps after the decimal separator if a thousand separator should disappear.

Describe the expected behavior

Cursor shouldn't jump after the comma separator.

Provide a CodeSandbox link illustrating the issue

https://codesandbox.io/s/thousandsgroupstyle-demo-forked-wir1uo?file=/src/App.js

Provide steps to reproduce this issue

  1. Open CodeSandbox
  2. Place cursor behind the 6 but before the comma separator ","
  3. Press Backspace
  4. Cursor now is after the comma separator instead of in front

Please check the browsers where the issue is seen

  • [ x] Chrome
  • Chrome (Android)
  • Safari (OSX)
  • Safari (iOS)
  • [ x] Firefox
  • Firefox (Android)
@s-yadav
Copy link
Owner

s-yadav commented Oct 25, 2022

Looking into it.

s-yadav added a commit that referenced this issue Oct 25, 2022
- Added isValidInputCharacter in NumberFormatBase to figure out if a character is allowed to be typed.
@s-yadav
Copy link
Owner

s-yadav commented Oct 25, 2022

Fixed on v5.1.0

@rene-stesl
Copy link
Author

Thanks, works like a charm!

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

2 participants