Skip to content

Add the submit event to the arguments of FormSubmitOptions.action #67334

@jnizet

Description

Which @angular/* package(s) are relevant/related to the feature request?

forms

Description

It would be nice if the function FormSubmitOptions.action, which defines what to do when a signal forms is submitted, could have access to the SubmitEvent that triggered the call to this function.

It would allow accessing the submitter of the event, allowing to know which button was used to submit the form, which is very useful when a form has two submit buttons (like "Send" and "Send later" for example, or "Save" and "Save as draft").

Proposed solution

Add a third argument event: SubmitEvent to the action function of FormSubmitOptions

Alternatives considered

Handle the submission using a (submit)="save($event)" event binding on the form, in order to receive the event, and then delegate to the submit function, without relying on the FormRoot directive and on the form's submission action.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions