telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
466 stars 215 forks source link

Splitter pane collapse issue with the changeDetection "OnPush" #4363

Open ErgoleGM opened 1 month ago

ErgoleGM commented 1 month ago

Describe the bug When we use the kendo-splitter-pane component in a component using as "changeDetection" the option: "ChangeDetectionStrategy.OnPush". When we want to collapse the "pane" with a double click, it remains open, but its contents is emptied (hidden by an ngIf)

To Reproduce Steps to reproduce the behavior: Get the sample given at https://www.telerik.com/kendo-angular-ui/components/layout/splitter/.

In the definition of the component in which we use the kendo-splitter, simply set the "changeDetection" to "ChangeDetectionStrategy.OnPush", double-click the split-bar.

You can test here: https://stackblitz.com/edit/angular-vdxtpl-qwyp2g?file=src%2Fapp%2Fapp.component.ts

  1. Un-comment the line 5 (changeDetection: ChangeDetectionStrategy.OnPush),
  2. double-click the split bar between "Inner splitter / left pane" and "Inner splitter / center pane"
  3. The left pane content is now emptied, but it's not collapse
  4. Re-comment the line 5 (//changeDetection: ChangeDetectionStrategy.OnPush),
  5. double-click the split bar between "Inner splitter / left pane" and "Inner splitter / center pane"
  6. The left pane content is now collapsed (OK)

Expected behavior As it's specified in telerik documentations, "To collapse a pane, you can also double-click the split-bar" so, double-clic on the split-bar have to collapse the pane.

Browser

ErgoleGM commented 1 month ago

Also, if you log the collapsedChange event, the behavior is now like expected

You can see; https://stackblitz.com/edit/angular-vdxtpl-y1rsbm?file=src%2Fapp%2Fapp.component.ts

destus90 commented 1 week ago

We have already observed the issue and temporarily fixed it with smth like

merge(pane.sizeChange, pane.collapsedChange).subscribe(() => this.changeDetector.markForCheck());