Search code examples
javascriptjquerykendo-uikendo-tooltip

Prevent kendo tooltip hide/close when clicking outside the tooltip?


I know that there are people ask kendo to prevent kendo tooltip from close/hide whenever we click outside the tooltip. They are suggesting it here but seems that it has not been implemented yet.

I couldn't find the method which closes/hides when we click outside kendo tooltip so far. I only found the event triggered when we click on close or cancel button on kendo tooltip. But is there any way/hackish way to achieve this using javascript/jquery/anything?


Solution

  • Like you see in link that you included the kendo tooltip (with autoHide: false property) hides when you:

    • click outside the tooltip
    • scroll page
    • hit Esc

    Until Telerik will not implement function to prevent it, the only way is using jquery event.stopImmediatePropagation(). For example for block tootlip from hide when you click outside you can write:

    $("#target").kendoTooltip({
        autoHide: false
    });
    $('html').on('mousedown', function(e){
        e.stopImmediatePropagation();
    });
    

    Working demo: http://dojo.telerik.com/ugUCI

    Unfortunately it will prevent any html onmousedown events like DropDownLists/ComboBoxes hiding etc.