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

Tooltip disappears immediately

3 Answers 152 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Anders Mad.
Top achievements
Rank 2
Anders Mad. asked on 30 Jan 2008, 07:20 PM
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

3 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 31 Jan 2008, 03:32 PM
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
0
Anders Mad.
Top achievements
Rank 2
answered on 05 Feb 2008, 06:15 PM

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

0
Georgi Tunev
Telerik team
answered on 08 Feb 2008, 02:29 PM
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
Tags
ToolTip
Asked by
Anders Mad.
Top achievements
Rank 2
Answers by
Tervel
Telerik team
Anders Mad.
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or