You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
I have a few fields on a FormGroup, and some of them I set an enabledWhile function to enable/disable them based on whether other fields have certain values or not. So far so good. The problem arises when I try to use the FormGroup to edit an existing item and execute a patchValue with all the data needed to update the FormGroup, and then the issues start: the fields that don't have any conditional enabled/disabled state, work just fine, but those that have the enableWith function applied don't get their value update on the UI (despite the FormGroup.value reflecting the values correctly).
I have to execute a setTimeout(this.formData.patchValue(data)) right below the first patchValue to update these neglected fields and reflect the value on the UI.
Expected behavior
I would expect that when I perform a patchValue, that the FormGroup gets correctly updated, even for those fields that have a enabledWhile/disabledWhile method applied.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Angular version: 11.0.0
Browser:
- [X] Chrome (desktop) version 87.0.4280.66
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
I have a few fields on a
FormGroup
, and some of them I set anenabledWhile
function to enable/disable them based on whether other fields have certain values or not. So far so good. The problem arises when I try to use theFormGroup
to edit an existing item and execute apatchValue
with all the data needed to update theFormGroup
, and then the issues start: the fields that don't have any conditional enabled/disabled state, work just fine, but those that have theenableWith
function applied don't get their value update on the UI (despite theFormGroup.value
reflecting the values correctly).I have to execute a
setTimeout(this.formData.patchValue(data))
right below the firstpatchValue
to update these neglected fields and reflect the value on the UI.Expected behavior
I would expect that when I perform a
patchValue
, that theFormGroup
gets correctly updated, even for those fields that have aenabledWhile
/disabledWhile
method applied.Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: