With ChangeDetectionStrategy.OnPush set, reactive from bindings dont work.

Hello,

I use the ejs-multiselect in combination with reactive forms. When I addionaly use the 

changedetection strategy onpush the form control never gets the current selected values from ejs-multiselect.

I created a litte sample appication to show the issue.

Run "npm install && npm start" in console. 

Comment in/out the code line "changeDetection: ChangeDetectionStrategy.OnPush" in the component declaration to see the different behaviours.


Regards

René


Attachment: syncfusionmultiselectreactiveform_9839e576.zip

1 Reply

SP Sureshkumar P Syncfusion Team June 6, 2022 11:29 AM UTC

Hi René,

This is not a component side issue when we set the ChangeDetectionStrategy.OnPush the default change detection is deactivated until reactivated. So, we suggest you use ChangeDetectionStrategy.Default instead of ChangeDetectionStrategy.OnPush to resolve the issue. To know more about the ChangeDetectionStrategy, please refer to the angular documentation


Documentation: https://angular.io/api/core/ChangeDetectionStrategy#changedetectionstrategy

Find the modified sample here: https://stackblitz.com/edit/angular-2blxi4?file=app.component.html,app.component.ts


Regards,

Sureshkumar P


Loader.
Up arrow icon