-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
What version of Remix are you using?
1.7.2
Steps to Reproduce
- Make a
<Form>
like so:
<Form>
<button type="submit" name="foo" value="override">Override</button>
<input type="hidden" name="foo" value="default" />
</Form>
- Click the "Override" button
Expected Behavior
The form fields should be serialized in tree order, i.e. foo=override&foo=default
(as is the case with a vanilla <form>
).
See Constructing the form data set in the HTML spec. Submitted fields should be sent in the order they appear in the DOM, including the submitter
(i.e. the submit button that was clicked).
Actual Behavior
The form is serialized as foo=default&foo=override
.
This is problematic on the server-side if you are relying on the order to indicate precedence. formData.get("foo")
will yield different values, depending on whether the form was submitted by Remix or native browser behavior.
See also #3611; prior to that fix it was broken in a different way (it would only serialize foo=default
)