You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.8.1
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
None
Describe the bug
Thanks for the awesome library!
I noticed some weird behavior when calling setFieldError in the onSubmit handler. Namely, when you submit multiple times without changing the text input, the error disappears.
In the linked code sandbox:
Enter a valid email
Click submit (an error appears)
Click submit again (the error disappears)
I would not expect the error to disappear.
As a workaround, I have disabled the button while there are errors. I did this using disabled={Object.keys(form.errors).length > 0}, but please let me know if there's a cleaner way (it might be nice to be able to call form.hasErrors() or something).
If possible, include a link to a codesandbox with a minimal reproduction
I get the same error.
When I use setFieldError in the onSubmit event, different things happen. The first time the error appears, it is hidden in the other submit operation.
Then it appears again when I submit again.
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.8.1
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
None
Describe the bug
Thanks for the awesome library!
I noticed some weird behavior when calling
setFieldError
in theonSubmit
handler. Namely, when you submit multiple times without changing the text input, the error disappears.In the linked code sandbox:
I would not expect the error to disappear.
As a workaround, I have disabled the button while there are errors. I did this using
disabled={Object.keys(form.errors).length > 0}
, but please let me know if there's a cleaner way (it might be nice to be able to callform.hasErrors()
or something).If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/spring-currying-3zc49y?file=%2Fsrc%2FApp.tsx%3A11%2C36
Possible fix
No response
Self-service
The text was updated successfully, but these errors were encountered: