Skip to content

Form stays dirty even after reverting fields back to default values #498

Description

@KiddoV

Environment

Package version:
reactive_forms: ^18.2.0

Content

Hi, I noticed that when I change any field in a form, its state becomes dirty as expected. But even if I type the value back to the original default value, the form still reports dirty = true.

Is this expected behavior?

It seems like the dirty state only checks whether the field was ever modified, not whether the current value matches the initial value. Is there a built-in way to track “dirty” based on comparing the current value with the default/initial value instead of just a boolean flip?

If not, what is the recommended way to implement this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions