Closed
Description
Is your feature request related to a problem?
When submitting a form with <Form action={useAction} />
the actionPath keeps the current urls search params. If you submit a form with <form action={useAction.actionPath} />
you lose the urls search params.
To keep url search params, i currently have to append to the formAction.actionPath
export const useAction = action$((formData, { url }) => {
return {
success: true,
};
});
<form action={formAction.actionPath + '&foo=111'} method="post">
<button>submit</button>
</form>
Describe the solution you'd like
Should both ways of submitting a form behave the same? If so, maybe allow passing an option to disable keeping params (not sure if there is a use case for this)?
const formAction = useAction({
preserveUrlSearchParams: false,
});
Describe alternatives you've considered
Also, for a separate issue, maybe there is a use case for an option like this?
const formAction = useAction({
dangerouslyAllowCrossSite: true,
});
Additional context
No response
Metadata
Metadata
Assignees
Labels
Remove this label when implementation is completeRemove this label when tests are verified to cover the implementationRemove this label when all critical discussions are resolved on the issueRemove this label when the necessary documentation for the feature / change is addedRemove this label when at least 2 core team members reviewed and approved the RFC implementation