Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jorroll opened this issue Jul 20, 2022 · 0 comments

Comments

@jorroll
Copy link
Owner

jorroll commented Jul 20, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant