Tooltip disappears immediately

4 posts, 0 answers
  1. Anders Mad.
    Anders Mad. avatar
    42 posts
    Member since:
    May 2006

    Posted 30 Jan 2008 Link to this post

    Hi, I'm showing a tooltip manually (ShowEvent="FromCode") using script on a focus event on an input type text element (hide on blur), but the tooltip disappears immediately.

    I debugged the code and seems that the click event on the input element bubbles up to the (by tooltip) body on-click event that removes the tooltip if the mouse is not over the tooltip. The event order should be fixed or you should also test if the mouse is over target control (from set_TargetControl).

    Thank you
  2. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 31 Jan 2008 Link to this post

    Hi Anders,

    I would rather suggest you try showing the tooltip after a small timeout using

    window.setTimeout(function()
    {
      //Show tooltip here
    }, 100);


    In this way you will "let" the event propagate up and then show the tooltip.

    Best regards,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anders Mad.
    Anders Mad. avatar
    42 posts
    Member since:
    May 2006

    Posted 05 Feb 2008 Link to this post

    Hi,

    Thank you, but I do at all times avoid starting a new thread to fix things – also there will be a delay and it might be too small.

    I do this hack now on load:

    // HACK - store original method  
    Telerik.Web.UI.RadToolTipControllerClass.prototype._hideOnBodyClickHACK = Telerik.Web.UI.RadToolTipControllerClass.prototype._hideOnBodyClick;  
    // Override  
    Telerik.Web.UI.RadToolTipControllerClass.prototype._hideOnBodyClick = function(e) {  
        var activeToolTip = this._activeToolTip;  
        if (activeToolTip != null && activeToolTip.get_TargetControl()) {  
            // Check if activator element is clicked (could be done better using the event target / source element).  
            if (activeToolTip._isMouseOverElement(e, activeToolTip.get_TargetControl()))  
                return;  
        }  
        // Call original method  
        Telerik.Web.UI.RadToolTipControllerClass.prototype._hideOnBodyClickHACK(e);  
    }; 

    /Anders

  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 Feb 2008 Link to this post

    Hello Anders,

    Thank you for sharing your approach with us - I logged this issue in our database for future consideration.


    Your points were updated.



    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top