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

Weird behaviour when using different IMEs with thousand seperator #843

Open
2 of 6 tasks
HeRo3S opened this issue May 31, 2024 · 4 comments
Open
2 of 6 tasks

Weird behaviour when using different IMEs with thousand seperator #843

HeRo3S opened this issue May 31, 2024 · 4 comments

Comments

@HeRo3S
Copy link

HeRo3S commented May 31, 2024

Describe the issue and the actual behavior

I tried to type 10000 to the input field using Windows' Vietnamese keyboard layout (using thousandSeperator props), but the output display incorrectly.
image

Though the output would display correctly when I exited the input field.

Describe the expected behavior

The input data display correctly when user trying to input.

Provide a CodeSandbox link illustrating the issue

Using the documentation's sandbox here:
https://codesandbox.io/p/sandbox/thousandsgroupstyle-demo-u3ip59?from-embed=

Provide steps to reproduce this issue

Use Windows' Vietnamese keyboard layout and type 10000 or more (must type 2 different numeric characters to see the bug)

Please check the browsers where the issue is seen

  • Chrome
  • Chrome (Android)
  • Safari (OSX)
  • Safari (iOS)
  • Firefox
  • Firefox (Android)
@tinncdev
Copy link

In your sandbox, the thousandsGroupStyle was set to indian style lakh so the output 11,10,000 is correct
Either remove thousandsGroupStyle or set it to thousand to match your expected output.

Reference to the doc: https://s-yadav.github.io/react-number-format/docs/numeric_format/#thousandsgroupstyle-string

@RyoheiTomiyama
Copy link

RyoheiTomiyama commented Oct 11, 2024

I guess,
he typed 10000, but displayed 1110000.

On MacOS, it looks like the following screenshot.
スクリーンショット 2024-10-11 14 15 57

@HeRo3S
Copy link
Author

HeRo3S commented Oct 11, 2024

Yeah, it only occurred so far on MS Windows with Microsoft's IME. I tried to ask a colleague who use MacOS to test it and didn't see any problem with it.
My only guess is that it's Microsoft's own way of handling input buffer in other IME that's causing the format function to kinda freak out.

@tinncdev
Copy link

tinncdev commented Oct 11, 2024

Did not notice the Windows' Vietnamese keyboard part in previous comment.

This is related to #636

which exactly similar to this react issue which closed for duplicated to this 9 years old issue

this was too much for my little pricing input so I ended up letting the input as is and just use numericFormatter method to show a small formatted text as hint bellow the input

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

3 participants