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

[@mantine/core] Number Input With allowNegative Attribute Allows Negative Form Values #6162

Closed
2 tasks done
AustinWildgrube opened this issue May 2, 2024 · 0 comments
Closed
2 tasks done

Comments

@AustinWildgrube
Copy link
Contributor

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.9.0

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

The NumberInput component incorrectly allows negative numbers despite setting the allowNegative attribute. When clicking the down arrow, it correctly reaches 0, but subsequent clicks result in the UI incrementing while the form value, managed by useForm, continues to decrement. I have tested this with both controlled and uncontrolled forms. I am not sure when this issue first started occurring, but I noticed it after upgrading to the latest version of both the core package and the forms package.

mantine.bug.mov

If possible, include a link to a codesandbox with a minimal reproduction

https://stackblitz.com/edit/stackblitz-starters-a4f4lm?file=app%2Fpage.tsx

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
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