Skip to content

Subscribing to nested FormGroup rawValue props will update whenever sibling props change #3

@jorroll

Description

@jorroll

If you have a FormGroup with multiple controls, observing control.rawValue.valueA will emit updates even when just control.rawValue.valueB changed.

The reason is that rawValue is changing whenever any nested value changes, so based on the current implementation this is correct behavior. Still, observing changes to rawValue or value is expected to be common enough that we should optimize for it. Perhaps we should store rawValue and value as nested Solidjs Store objects rather than as memos (for both FormGroup and FormArray). This would allow observing deeply nested children and only getting updates when the observed properties change.

At the moment, you could workaround this issue by, e.g., observing control.controls.valueA.rawValue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions