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]: Not supporting <ValidatedForm reloadDocument> #241

Open
1 of 4 tasks
Mange opened this issue Jan 30, 2023 · 0 comments · May be fixed by #286
Open
1 of 4 tasks

[Bug]: Not supporting <ValidatedForm reloadDocument> #241

Mange opened this issue Jan 30, 2023 · 0 comments · May be fixed by #286
Labels
bug Something isn't working

Comments

@Mange
Copy link

Mange commented Jan 30, 2023

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/with-zod": "^2.0.5",
"remix-validated-form": "^4.6.7",
"zod-form-data": "^1.2.4"

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

https://github.com/Mange/remix-redirect-repro

Steps to Reproduce the Bug or Issue

  1. npm install && npm run dev
  2. Go to http://localhost:3000
  3. Test the different ways to submit.

Expected behavior

Submitting a <ValidatedForm reloadDocument> should work the same was as a <Form reloadDocument>.

Screenshots or Videos

image

All but the Form with reloadDocument

image

Form with reloadDocument

image

Platform

  • OS: Linux (Not relevant)
  • Browser: Brave (Not relevant)
  • Version: Not relevant

Additional context

This breaks in ValidatedForm because it uses useSubmit under the hood, which does not respect reloadDocument or (AFACT) offers similar functionality.

I might not be diagnosing this issue correctly. It's all a guess from me.

I think a reloadDocument option should make it submit for a full page submit, like noValidate does, when JS is not available, but still submit the <form> for real without useSubmit if validations pass when JS is available.

Overall, I only want this behavior due to the lack of "hard redirects" in Remix, where I have some non-remix routes that I want to redirect to. If this is ever fixed upstream (remix-run/react-router#9859), then I won't care about this anymore.

@Mange Mange added the bug Something isn't working label Jan 30, 2023
@JosiahSayers JosiahSayers linked a pull request May 20, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant