Firefox – jquery Error: event is undefined in Tippy Plugin WordPress

I have this small issue in Firefox which I’m unable to repair… does anyone know a possible solution?

TypeError: event is undefined
tippy_positions.curPageX = event.clientX + tippy_positions.scrollPageX;
in (line 335, col 3) http://example.com/wp-content/plugins/tippy/jquery.tippy.js?ver=6.0.0

Read More

This breaks the whole website only in firefox when autoshow=true.
Here file link: https://github.com/thechrisroberts/tippy/blob/master/jquery.tippy.js

Thank You!

Related posts

Leave a Reply

1 comment

  1. sometimes if you trying to access event object directly then it runs in chrome but not in firefox. so solution is to take custom position related to div

    open jquery.tippy.js
    go to function getPositions ( line no 323)

    replace line no 325 to 349

           if (!event) {
                event = window.event;
            }
            var x = '';
            var y = '';
            if( event == undefined ) {
                var offset = $("#"+tipId+"_link").offset();
                x = offset.left;
                y = offset.top;
            } else {
                x = event.clientX;
                y = event.clientY;
            }
    
            tippy_positions.scrollPageX = $(window).scrollLeft();
            tippy_positions.scrollPageY = $(window).scrollTop();
    
            tippy_positions.viewScreenX = $(window).width();
            tippy_positions.viewScreenY = $(window).height();
    
            tippy_positions.curPageX = x + tippy_positions.scrollPageX;
            tippy_positions.curPageY = y + tippy_positions.scrollPageY;
    
            tippy_positions.viewPageX = x;
            tippy_positions.viewPageY = y;
    

    and it will work for you!!