Completed
Last Updated: 16 May 2024 06:38 by ADMIN
Martin
Created on: 09 May 2024 14:18
Category: TreeView
Type: Feature Request
0
Stop Unnecessary Caret Regenerating in Angular TreeView

I realise the real villain here is Angular change detection, but anyways...

https://stackblitz.com/edit/angular-3r25bb?file=src%2Fapp%2Fapp.component.ts

This is sort of halfway between a bug and a feature: I've noticed when i add any kind of mouse event to a tree view node template then some global change detection kicks in, and in turn this seems to cause the svg carets in treeview to be constantly regenerated e.g. open the above stackblitz and move the mouse up and down the tree - if you look in the chrome inspector elements tab and go to the <kendo-svgicon> carets you will see their child nodes ( > svg > path) glow as they are being replaced - even though the replacement nodes are no different. If you edit the data in these nodes e.g. path coords, you'll see it get replaced when the mouse is moved up/down the tree again

This doesn't seem to affect any other parts of the tree view, just the carets... is there a chance this could be looked into why this is happening, and hopefully stopped? (our ultimate reason is we're also listening to DomChange events with a mutation observer on the tree and these changes cause many DomChange events that swamp the ones we actually want.)

(Also, I have looked into changing the change detection behaviour in angular but it isn't fine-grained enough to ignore just one particular declaration of an event listener in a template - it's all big sweeping component-level changes or using renderer classes and native listeners which are unwieldy, especially when the target concerned is in a ng-template like in this instance.)

1 comment
ADMIN
Martin Bechev
Posted on: 16 May 2024 06:38

Hi Martin,

Thank you for the provided feedback.

I am glad to announce that this has been fixed in the latest v16 of the components. Please check the updated example:

https://stackblitz.com/edit/angular-zyrjgj

Try updating the packages and let me know how it goes:

https://www.telerik.com/kendo-angular-ui/components/installation/up-to-date/#toc-updating-to-latest-versions

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources