8000 CVA Method - writeValue() --> doesn‘t correspond with Signal Reactivity · Issue #62272 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content
CVA Method - writeValue() --> doesn‘t correspond with Signal Reactivity #62272
Closed
@FinnGH789

Description

@FinnGH789

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: formsneeds reproductionThis issue needs a reproduction in order for the team to investigate further

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0