Skip to content

Signal Forms: Mark all as touched when not hidden #66344

@paulstelzer

Description

@paulstelzer

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

forms

Description

At the moment you can only mark all fields as touched when using the submit method. In our use case this will lead to undesirable behavior.

Eg. we habe two fields (subject and message). The message is hidden and will only be displayed when entering a subject first. If I tap on submit without entering anything, the subject has an error message. After adding a subject, the message will have the error immidiatly because through submit it was marked as touched (although it was hidden).

Proposed solution

Let the developer decide which fields to mark as touched or add an option to markAsTouched, but only mark visible fields as touched (ignore hidden fields).

Alternatives considered

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions