IfnotFr / PopConfirm

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onclick event undefined

boussou opened this issue · comments

When you confirm using popconfirm, there is two events generated that call the onclick function.
during the second call I had a null event.
this is the exact error

jquery.popconfirm.js:135 Uncaught TypeError: Cannot read property 'preventDefault' of undefined
    at init.<anonymous> (jquery.popconfirm.js:135)
    at HTMLButtonElement.<anonymous> (jquery.popconfirm.js:143)
    at HTMLButtonElement.e (jquery.min.js:3)
    at HTMLButtonElement.dispatch (jquery.min.js:3)
    at HTMLButtonElement.i (jquery.min.js:3)

``
I had to add line 136/137 the "if(e)" : 

            if(e)e.preventDefault();
            if(e)e.stopPropagation();

besides, it seems that the the lib make no use of the object e.
appeared on chromium Version 57.0.2987.133 (64-bit) and IE last version.

Thanks for the bug report.

What to you mean by "there is two events generated that call the onclick function" ?

Don't remember, I think I meant that the callback is called 2 times.
I can do further analysis if you ask (by doing a rollback)

Thats weird, i never had this behaviour before.

An analysis will be much appreciated :)

The undefined event is fixed with 344cf45