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

pointer position is resetted if value is number #851

Closed
raDiesle opened this issue Aug 12, 2024 · 2 comments
Closed

pointer position is resetted if value is number #851

raDiesle opened this issue Aug 12, 2024 · 2 comments

Comments

@raDiesle
Copy link

Describe the issue and the actual behavior

  • when number type value is passed to the input, its cursor is jumping in > v4, because value ".00" is considered different than 0

#850

Describe the expected behavior

  • cursor is never jumping. in the component there should be a Number(value) === Number(prevValue) check, which will ignore types, like it was on v5

Provide a CodeSandbox link illustrating the issue

https://codesandbox.io/p/sandbox/alloweddecimalseparators-demo-forked-4z33vm

Provide steps to reproduce this issue

Please check the browsers where the issue is seen

  • [X ] Chrome
@s-yadav
Copy link
Owner

s-yadav commented Aug 25, 2024

Number(value) === Number(prevValue) won't work as formatted value can change due to change on format props as well. prefix/suffix, separator etcs.

Anyways this would happen, only when user is typing decimal character on empty input with decimalScale and fixedDecimalScale set. Putting a fix around this.

Meanwhile I would suggest to not use floatValue on onValueChange.

@s-yadav
Copy link
Owner

s-yadav commented Aug 25, 2024

Fixed on 5.4.1

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