Animate change in menu items

1 Answer 69 Views
Animation Menu
Karalynn
Top achievements
Rank 1
Karalynn asked on 26 May 2023, 02:30 PM
I have a Kendo Menu that has a custom menu item renderer. Its list of menu items is controlled by Redux, and the items in the list change from time to time. I was wondering if there was a way to animate the transition of menu items when the content changes. Adding an animation to the item renderer didn't seem to make a difference, and the content of the menu still changes without a transition.

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 29 May 2023, 08:39 PM

Hello Karalynn,

As far as I am aware, there is no way to add animation when a content of an element is changed. With that in mind, the only option would be to manually add/remove a class name that will trigger the animation for the items (note that you will have to wrap the content within the itemRender in a DIV or span element or use the default added class names). Additionally, when the data changes you can add a class name to the wrapping element of the Menu and animate all items. Here is an example with such implementation:

Please note that if you want to add the animation only to the items which data is changed you will have to add some different logic and maybe add specific class name to the items within the itemRender that have changed (maybe by adding a time stamp with the last update or some other custom logic).

 

Regards,
Konstantin Dikov
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!

Tags
Animation Menu
Asked by
Karalynn
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or