-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(remix-react): fix submitter serialization (alt approach) #4475
Conversation
🦋 Changeset detectedLatest commit: 4dbdc64 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7b72226
to
35f7aac
Compare
This feels a tad less hacky than the other approach, but it's a lot more code to maintain, and as the spec evolves we'll have to keep tweaking the implementation, increasing the likelihood of bugs/etc. |
Bring `<Form>` submissions in line with the spec with respect to how and where form submitters are serialized within the data set. We accomplish this by constructing the form data set ourselves according to the spec. Problems fixed: 1. Serialize submitters in tree order (i.e. where they appear in the DOM) 2. Serialize Image Button submitter correctly (i.e. separate x and y coordinate entries, rather than a single empty entry) 3. Stop sending multiple entries in older WebKit References: remix-run#4342 Spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set
35f7aac
to
4dbdc64
Compare
Closing in favor of remix-run/react-router#9866, since the code has moved there |
This is the RR port of remix-run/remix#4475 Bring `<Form>` submissions in line with the spec with respect to how and where form submitters are serialized within the data set. We accomplish this by constructing the form data set ourselves according to the spec. Problems fixed: 1. Serialize submitters in tree order (i.e. where they appear in the DOM) 2. Serialize Image Button submitter correctly (i.e. separate x and y coordinate entries, rather than a single empty entry) 3. Stop sending multiple entries in older WebKit References: remix-run/remix#4342 Spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set
Note: I have two proposals on how we can fix the submitter serialization bugs. The other approach is here.
Bring
<Form>
submissions in line with the spec with respect to how and where form submitters are serialized within the data set.Alt solution: We accomplish this by constructing the form data set ourselves according to the spec.
Problems fixed:
References: #4342
Spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set