mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #426] [MERGED] fix: next/form submitter overrides and query-string GET URLs #564
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#564
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/426
Author: @JaredStowell
Created: 3/10/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:jstowell/fix-next-form-submitter-and-query-handling📝 Commits (3)
a30cc44Add submitter handling to form shimc48d610Update form shim URL validationeff8c84Fix form submit attribute casing📊 Changes
11 files changed (+677 additions, -51 deletions)
View changed files
📝
packages/vinext/src/shims/form.tsx(+136 -9)📝
packages/vinext/src/shims/link.tsx(+2 -1)📝
packages/vinext/src/shims/router.ts(+2 -2)📝
packages/vinext/src/utils/query.ts(+22 -0)📝
tests/e2e/app-router/form.spec.ts(+81 -28)➕
tests/fixtures/app-basic/app/search-alt/page.tsx(+19 -0)📝
tests/fixtures/app-basic/app/search/page.tsx(+4 -2)📝
tests/fixtures/app-basic/app/search/search-form.tsx(+53 -6)📝
tests/form.test.ts(+289 -3)📝
tests/link.test.ts(+22 -0)➕
tests/query.test.ts(+47 -0)📄 Description
Fix
next/formGET submissions so they preserve existing query strings and honor the clicked submitter's overrides.This fixes two concrete bugs:
actionbuilt malformed URLsformAction,formMethod, and submittername=valuewere not appliedWhat changed
Updated
next/formto:formActionformMethodname=valuein submitted form dataFormData(form, submitter)is unavailableAdded a shared URL helper for safe query param merging and reused it in:
next/formnext/linkobject href resolutionTests
Added/updated coverage for:
next/formsubmit interception behaviorformActionformMethod="GET"overriding a POST formname=valueLinkhrefs that already contain query strings and hashesVerification
Ran:
pnpm test tests/form.test.ts tests/query.test.ts tests/link.test.ts tests/shims.test.ts -t "next/form|Form|appendSearchParamsToUrl|Link resolveHref"PLAYWRIGHT_PROJECT=app-router pnpm run test:e2e tests/e2e/app-router/form.spec.ts --repeat-each 4pnpm run fmtpnpm run typecheckpnpm run lintpnpm run buildpnpm test🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.