Skip to content

Custom plugin form gets submitted twice on click #9571

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

Closed
hdodov opened this issue Nov 27, 2024 · 2 comments
Closed

Custom plugin form gets submitted twice on click #9571

hdodov opened this issue Nov 27, 2024 · 2 comments

Comments

@hdodov
Copy link
Contributor

hdodov commented Nov 27, 2024

Describe the Bug

This appears to be a regression. When I upgraded from version 3.0.0-beta.119 to 3.2.1, the forms in my custom plugins started getting submitted twice when the submit button gets clicked. Here's a reproduction video:

Screen.Recording.2024-11-27.at.19.26.59.mov

Link to the code that reproduces this issue

https://github.com/hdodov/test-payload/tree/form-submitted-twice

Reproduction Steps

  1. Clone the reproduction repo: https://github.com/hdodov/test-payload/tree/form-submitted-twice
  2. pnpm docker to start the project
  3. Open http://localhost:3000/admin/test-plugin
  4. Write something in the field
  5. Click "Submit!"
  6. You'll see two alerts sent from the onSubmit handler

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.9.0
Relevant Packages:
  payload: 3.2.1
  next: 15.0.3
  @payloadcms/db-mongodb: 3.2.1
  @payloadcms/email-nodemailer: 3.2.1
  @payloadcms/graphql: 3.2.1
  @payloadcms/next/utilities: 3.2.1
  @payloadcms/payload-cloud: 3.2.1
  @payloadcms/richtext-lexical: 3.2.1
  @payloadcms/translations: 3.2.1
  @payloadcms/ui/shared: 3.2.1
  react: 19.0.0-rc-65a56d0e-20241020
  react-dom: 19.0.0-rc-65a56d0e-20241020
Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.6.0: Thu Sep 12 23:34:49 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_X86_64
  Available memory (MB): 32768
  Available CPU cores: 16
@hdodov hdodov added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Nov 27, 2024
@github-actions github-actions bot added created-by: Contributor and removed validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Nov 27, 2024
@jessrynkar
Copy link
Member

Hi @hdodov sorry we didn't get you a response sooner - the double form submit issue has been resolved in a previous release, updating to latest v3.37.0 will fix this behavior. Thanks for raising this 🙌

@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label May 8, 2025
Copy link
Contributor

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants