Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Button's in forms cause double submits onEnter

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

Start by inspecting react-submittable's form and button handling, then reproduce the case where a button's onSubmit callback matches the required onEnter callback and pressing Enter submits twice. Done means the component prevents the duplicate submit without requiring callers to invoke event.preventDefault() themselves.

Written by the indexing model from the issue text.

Description

Because a button's default type is submit and a form will trigger a submit on enter, giving a button inside of <Submittable> an onSubmit callback that is the same as a the required onEnter callback will cause double submit.

This can be prevented by invoking event.preventDefault() inside of the callback, but we might want to look at preventing inside of react-submittable as this seems unexpected.

Dominant language
JavaScript
Stars
18
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.