[NEXT-1228] Adding hidden form input at start of form overrides ACTION_ID when using server action #50087
Closed
1 task done
Labels
area: app
App directory (appDir: true)
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.1.0 Relevant packages: next: 13.4.4-canary.0 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/gracious-http-zqknr4
To Reproduce
Create a form with a server action. Add a hidden input as the direct child of the form.
Describe the Bug
When adding a hidden form input at the start of a form, it appears twice in the DOM and the posted data to the server action. With it, the automatically inserted hidden
$ACTION_ID
seems to get overwritten.When moving the input to the bottom of the form, all is working fine.
Expected Behavior
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1228
The text was updated successfully, but these errors were encountered: