Repository navigation
feat(forms): add default updateOn values to groups and arrays - #18536
Conversation
2194b86 to
b5323b2
Compare
|
You can preview 0ba8999 at https://pr18536-0ba8999.ngbuilds.io/. |
|
You can preview 2194b86 at https://pr18536-2194b86.ngbuilds.io/. |
|
You can preview b5323b2 at https://pr18536-b5323b2.ngbuilds.io/. |
There was a problem hiding this comment.
nit: Also check the value is unchanged when blurred?
|
You can preview 7231271 at https://pr18536-7231271.ngbuilds.io/. |
IgorMinar
left a comment
There was a problem hiding this comment.
please add short property-level api doc snippet
This commit adds support for setting default `updateOn` values
in `FormGroups` and `FormArrays`. If you set `updateOn` to
’blur’` at the group level, all child controls will default to `’blur’`,
unless the child has explicitly specified a different `updateOn` value.
```
const c = new FormGroup({
one: new FormControl()
}, {updateOn: blur});
```
It's worth noting that parent groups will always update their value and
validity immediately upon value/validity updates from children. In other
words, if a group is set to update on blur and its children are individually
set to update on change, the group will still update on change with its
children; its default value will simply not be used.
|
You can preview e4695c2 at https://pr18536-e4695c2.ngbuilds.io/. |
|
You can preview c838fe3 at https://pr18536-c838fe3.ngbuilds.io/. |
…ar#18536) This commit adds support for setting default `updateOn` values in `FormGroups` and `FormArrays`. If you set `updateOn` to ’blur’` at the group level, all child controls will default to `’blur’`, unless the child has explicitly specified a different `updateOn` value. ``` const c = new FormGroup({ one: new FormControl() }, {updateOn: blur}); ``` It's worth noting that parent groups will always update their value and validity immediately upon value/validity updates from children. In other words, if a group is set to update on blur and its children are individually set to update on change, the group will still update on change with its children; its default value will simply not be used.
…ar#18536) This commit adds support for setting default `updateOn` values in `FormGroups` and `FormArrays`. If you set `updateOn` to ’blur’` at the group level, all child controls will default to `’blur’`, unless the child has explicitly specified a different `updateOn` value. ``` const c = new FormGroup({ one: new FormControl() }, {updateOn: blur}); ``` It's worth noting that parent groups will always update their value and validity immediately upon value/validity updates from children. In other words, if a group is set to update on blur and its children are individually set to update on change, the group will still update on change with its children; its default value will simply not be used.
…ar#18536) This commit adds support for setting default `updateOn` values in `FormGroups` and `FormArrays`. If you set `updateOn` to ’blur’` at the group level, all child controls will default to `’blur’`, unless the child has explicitly specified a different `updateOn` value. ``` const c = new FormGroup({ one: new FormControl() }, {updateOn: blur}); ``` It's worth noting that parent groups will always update their value and validity immediately upon value/validity updates from children. In other words, if a group is set to update on blur and its children are individually set to update on change, the group will still update on change with its children; its default value will simply not be used.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR adds support for setting default
updateOnvalues inFormGroupsandFormArrays. If you setupdateOnto'blur'at the group level, all child controls will default to'blur', unless the child has explicitly specified a differentupdateOnvalue.It's worth noting that parent groups will always update their value and validity immediately upon value/validity updates from children. In other words, if a group is set to update on
blurand its children are individually set to update onchange, the group will still update on change with its children; its default value will simply not be used.Upcoming PRs will address:
See more context in #18408, #18514, and the design doc.