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

5 posts, 1 answers
  1. Jacob
    Jacob avatar
    21 posts
    Member since:
    Dec 2011

    Posted 07 Jul 2015 Link to this post

    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?

  2. Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 09 Jul 2015 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Jacob
    Jacob avatar
    21 posts
    Member since:
    Dec 2011

    Posted 09 Jul 2015 in reply to Dimo Link to this post

    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).

     

  5. Answer
    Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 10 Jul 2015 Link to this post

    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!
     
  6. Jacob
    Jacob avatar
    21 posts
    Member since:
    Dec 2011

    Posted 10 Jul 2015 in reply to Dimo Link to this post

    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?

     

Back to Top
Kendo UI is VS 2017 Ready