Emit value when writeValue(null|undefined) + defaultValues defined#152
Emit value when writeValue(null|undefined) + defaultValues defined#152ntziolis wants to merge 1 commit intocloudnc:masterfrom
Conversation
…nternally stored value
|
@maxime1992 This is ready for review by now. |
|
This LGTM but I'm also afraid I might be missing something. I'm pretty sure that we did set to off for a good reason and either it may be dangerous to turn it back on for some cases or we may need to do that for other cases. @zakhenry any idea on your side? |
|
@maxime1992 Disabling it was/is the correct thing todo. As the intend is that as the same value that is passed in shouldn't cause an event to be bubbled back up to the parent form. However due to
this is a case where we should emit as otherwise the internal state of the sub form is different than the value (for the sub form) in the parent form. I was careful to test if there are any cycles created but could not find issues with it so far. We have this code (money patched) in production use case since about 1 month and are very happy with it. |
This PR addresses a bug where data inside a sub-form does not matching the data in the control in the parent form until additional changes are being made to the sub-form (for example via user input).
As outlined in #86 there are situations where we should be emitting from inside writeValue:
reset()is triggered on the outer form and there are default values specified in the sub formwriteValuenullorundefinedand has default values