jQuery plugin preventing .on(click) behaviour

320 Views Asked by At

Desired Behaviour

I want to trigger an action on clicking a Selectric dropdown.

Current Behaviour

The action is only occurring when clicking on the Selectric dropdown the second time.

Steps To Reproduce

01) In Firefox, with Firebug enabled, go to:

http://lcdsantos.github.io/jQuery-Selectric/demo.html.

(It is running v1.8.5 of the script - the same version that I am using)

02) Add this to the console in Firebug and run it:

$(document).on("click",".selectric:first", function () {
console.log("hello world!");
});

03) Click on the label of the first selectric dropdown (nothing will happen).

04) Whilst the dropdown is still open, click on it again and `hello world!" will be printed to the console.

So what seems to be happening is that the plugin is preventing the on() method from firing the first time.

Is there anyway to prevent this?

1

There are 1 best solutions below

0
On BEST ANSWER

you can place your code in _open function at line 347. i can't understand why e.stopPropagation() at line 352 stops your event handler