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

Form drops the submit event when a submitInterceptor is set

Open Beginner friendly
#3,541 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

Start in Form.tsx at the onSubmit wrapper shown in the issue, then find the SubmitInterceptor type and the tests covering form submission and interceptors. Check how the submit event is passed to handlers when no interceptor is set, and compare that behavior with the intercepted path. Done when an interceptor can access and forward the event, and tests cover the submitter being available to the handler.

Written by the indexing model from the issue text.

Description

bug

Problem

When a submitInterceptor is set via FormSettingsProvider, Form drops the submit event:

// Form.tsx
const onSubmit = submitInterceptor
  ? (values) => submitInterceptor(onSubmitProp, values, { form })
  : onSubmitProp;

onSubmit(values, event) is still called with the event, but the wrapper only forwards values. The SubmitInterceptor type has no event parameter either, so an interceptor cannot pass it on to submit.

Impact

Handlers that read the pressed submit button from the event (event.nativeEvent.submitter) always get undefined as soon as an interceptor is active. In mStudio every modal is wrapped in a FormSettingsProvider with an interceptor (modal analytics), so forms with a second submit button ("Save and create another", name="submitKeepOpen") can no longer tell which button was pressed – the modal always closes.

An interceptor also cannot see which button was used, e.g. to track it.

Proposal

Forward the event to the interceptor and add it to the type:

export type SubmitInterceptor = <F extends FieldValues = FieldValues>(
  submit: FormOnSubmitHandler<F>,
  values: F,
  context: SubmitInterceptorContext<F> & { event?: BaseSyntheticEvent },
) => ReturnType<FormOnSubmitHandler<F>>;
const onSubmit = submitInterceptor
  ? (values, event) => submitInterceptor(onSubmitProp, values, { form, event })
  : onSubmitProp;

Interceptors then call submit(values, event).

Seen in @mittwald/flow-react-components 1.5.22, still present in 1.5.27.

Dominant language
TypeScript
Stars
15
Forks
4
Avg merge
2d 7h
Merged PRs (30d)
197

Getting set up

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.

More from mittwald/flow

All issues in mittwald/flow

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.