InputSwitch not firing change detection on external value change with Push Strategy #6434
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-kxjjv5?file=src%2Fapp%2Fapp.component.ts
Current behavior
The
writeValue
method does not fire change detection.When using ChangeDetectionStrategy.OnPush value gets set later and change doesn't propagate.
Expected behavior
The component should work same with and without the OnPush change detection strategy.
Minimal reproduction of the problem with instructions
When you disable ChangeDetectionStrategy.OnPush it works, but with change detection on UI doesn't refresh, because
writeValue
doesn't trigger the change event.What is the motivation/use case for changing the behavior?
InputSwitch used within components with OnPush strategy do not get value properly initialized. This is because the method
writeValue
is called after the component has been drawn and initialized, and change is never propagated.Please tell us about your environment:
Linux Ubuntu, Yarn, Webstorm
Angular version: 5.X
6.1.1
PrimeNG version: 5.X
6.1.3
Browser: all
Language: all
The text was updated successfully, but these errors were encountered: