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

[Bug]: Unhandled error setting isSubmitting after form unmounts #355

Open
1 of 4 tasks
haines opened this issue Mar 28, 2024 · 0 comments
Open
1 of 4 tasks

[Bug]: Unhandled error setting isSubmitting after form unmounts #355

haines opened this issue Mar 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@haines
Copy link
Contributor

haines commented Mar 28, 2024

Which packages are impacted?

  • remix-validated-form
  • @remix-validated-form/with-zod
  • @remix-validated-form/with-yup
  • zod-form-data

What version of these packages are you using?

  • remix-validated-form: 5.1.5

Please provide a link to a minimal reproduction of the issue.

https://codesandbox.io/p/devbox/vigilant-banach-dy5vkk

Steps to Reproduce the Bug or Issue

We have a validated form in a modal with an onSubmit callback that calls event.preventDefault() and unmounts the modal component.

This causes an unhandled error "Cannot set properties of undefined (setting 'isSubmitting')".

  1. Load the repro sandbox
  2. Open the console
  3. Submit the form by clicking "Done"
  4. See the error in the console

Expected behavior

Unmounting the form on submission doesn't cause an error.

Screenshots or Videos

Screen.Recording.2024-03-28.at.13.52.41.mov

Platform

  • OS: macOS, Linux
  • Browser: Chrome
  • Version: 118, 122

Additional context

No response

@haines haines added the bug Something isn't working label Mar 28, 2024
@haines haines changed the title [Bug]: Unhandled error setting `is [Bug]: Unhandled error setting isSubmitting after form unmounts Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant