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

Add support for reloadDocument prop #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JosiahSayers
Copy link

Fixes #241

@vercel
Copy link

vercel bot commented May 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
remix-validated-form ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 11:27pm

@JosiahSayers JosiahSayers changed the title respect reloadDocument prop Add support for reloadDocument prop May 20, 2023
);
}}
onSubmit={
reloadDocument
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As-is, this is going to skip all validations, which I'm not sure is desirable. Shouldn't we validate, then submit the form via a full page reload? Not sure off the top of my head how to handle that situation when there's a submitter other than the form though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s a good point. I was going after this with the thought process that if you wanted a full page reload you would be okay with the server handling validation, like when JS isn’t running clientside. I can see how that’s not a super desirable solution though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just hit this "bug" while upgrading from Remix 1.8, to 1.19.0.
Seems like something changed in the framework (probably when it was rewritten on top of react-router), that my use case fail:

<ValidatedForm reloadDocument> on a regular route, posting to a resource route that generates and download a PDF.

Used patch-package to implement this PR approach, but would definitely love something that keeps client-side validation.

Anything I can do to help this PR move forward?

@Mange
Copy link

Mange commented Nov 14, 2023

Is there anything I can help you with to get this out faster?

@JosiahSayers
Copy link
Author

Is there anything I can help you with to get this out faster?

This fell off my radar as things have gotten busy for me. I don't really have the time to work on a fix at the moment, anyone who does can feel free to pick it up.

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

Successfully merging this pull request may close these issues.

[Bug]: Not supporting <ValidatedForm reloadDocument>
4 participants