Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Tooltip doesn't hide when element lost focus when set to showOn focus

$
0
0

Sorry Dimiter,

...but the problem with autoHide is an ISSUE.

Showing the tooltip is related to an event (mouse enter, focus). So it should be normal that when that event ends (mouse leaves or focus is lost) that hiding occurs. It might be that your documentation describes (if it describes) the current (in my opinion buggy) behavior.

To my defense I can only add, that f.e. bootstrap's tooltip worked as most people expect (with auto-hiding if focus is lost). I also feel that the possibility to have custom JS functions to set up bootstraps JS was more comfortable.

I had to change:

         // note: extra lines of code are needed to override jQuery tooltip fnc.
        var bootstrapTooltip = $.fn.tooltip.noConflict();
        $.fn.bstooltip = bootstrapTooltip;
        $('[data-toggle=tooltip]').bstooltip({ container: "body" });

to:

        var $tooltips = $('[data-toggle=tooltip]');
        $tooltips.each(function (index, elem) {
            var $elem = $(elem);
            var trigger = $elem.attr('data-trigger');
            var originalTitle = $elem.attr('data-original-title');
            var placement = $elem.attr('data-placement');

            $elem.kendoTooltip({
                autoHide: true,
                showOn: trigger,
                position: placement,
                content: function(e) {
                    var target = e.target;
                    return target.attr('data-original-title');
                }
            });
        });​


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>