This is a migrated thread and some comments may be shown as answers.

Delay between 'click' and 'deactivate' because of animation

4 Answers 35 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 2
Jacob asked on 07 Jul 2015, 04:12 PM

Hi,

We are working with the Context Menu.  The problem we are dealin with is an unwanted 'flash' of content because of a delay between the menu's click event and its deactivate event. 

A simplified example can be found here: http://dojo.telerik.com/IpOXI/3

Basically, the deactivate event is not fired until the animation of the menu is complete. We would prefer if there was not such a delay between the events.

What are the best ways of handling this problem?

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Jul 2015, 08:16 AM
Hello Jacob,

Yes, the deactivate event is fired after the animation is complete and this is by design. Is there a reason why you don't want to use the close event, which seems more suitable in your case?

http://docs.telerik.com/kendo-ui/api/javascript/ui/contextmenu#events-close

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jacob
Top achievements
Rank 2
answered on 09 Jul 2015, 05:16 PM

Hi Dimo,

 Thank you for the response. I realize that I accidentally miscommunicated the point of my post.  

 I have created another example which will better demonstrate the problem we are seeing. http://dojo.telerik.com/IpOXI/4

In summary, the problem is that the 'deactivate' event is fired right before the menu is actually gone (a little earlier than it should be).

 

0
Accepted
Dimo
Telerik team
answered on 10 Jul 2015, 12:15 PM
Hello Jacob,

By definition, the deactivate event is fired when the animation is complete and for this purpose, an animation complete callback is used. As far as I can see, the leftovers of the Menu are visible in Chrome only.

In case, for some specific reason, you need to menu to be completely invisible at the time the event handler is executed, you can wrap the handler code in setTimeout.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jacob
Top achievements
Rank 2
answered on 10 Jul 2015, 01:22 PM

Hey Dimo,

 Thank you for your response. Those details are helpful -- I didn't expect this to have minor differences across browsers, but we never do expect such a thing do we?

 

Tags
Menu
Asked by
Jacob
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Jacob
Top achievements
Rank 2
Share this question
or