Closed
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
Yes
Description
The writeValue() method is called by Angular during change detection. If you update a signal within this method, the change may not be immediately visible to the view or to computed signals/effects until the next change detection cycle.
Problem:
// Inside the ControlValueAccessor writeValue(value: string): void { mySignal.set(value); // ❌ Updates the signal, but view/effects may not reflect it immediately }
My Solution:
writeValue(value: string): void {
requestAnimationFrame(() => {
mySignal.set(value); // ✅ Defer update so it reflects in the next cycle
});
}
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No Error, just no Value in the UI, but in der Form-Value itself, the Value is right.
Within the next CD the Signal shows up
Please provide the environment you discovered this bug in (run ng version
)
Angular 19
NVM Version 22.15
Anything else?
No response