Skip to content

[v2] Port submit metadata support from v1 #2303

Description

@LeCarbonator

Submit metadata has not yet been implemented in v2. Adding it would allow metadata associated with a submission to remain available throughout the relevant form lifecycle.

Submit metadata should be available in the following places:

  • Validators: Optional, because a validator may run for an event other than submission.
  • Listeners: Always optional to keep the shared listener context manageable.
  • onSubmit: Required. The callback should receive the effective metadata, using the per-submission override when provided and the configured default otherwise.

Some thoughts

For validators, a discriminated union with a submit event could make the metadata available with stronger type safety only when the event is a submission. Listener metadata should likely remain optional because expressing the same relationship in the shared listener types may be too cumbersome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimeThis issue affects the runtime of the library.area: typesThis issue affects the types of the library.scope: coreThis issue affects the core package, meaning any adapter is also affected by it.type: enhancementThis requests an enhancement to existing behaviour.v2This issue affects v2 as well.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions