Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why doesn't the jquery change event fire when i use the up or down arrows on a select?

I am listening to the change event of a select dropdown using jquery and the livequery plugin.

$(".myDropdown").livequery("change", function () {
});

one thing i noticed (i am using firefox) is that

The event handler doesn't fire from hitting the up and down arrows when i have the select focused (the up and down arrow DO change the entries)

Why doesn't the change event fire when i move the arrows key up and down and is there a recommendation or workaround for this?

like image 466
leora Avatar asked Sep 16 '11 23:09

leora


1 Answers

If what Malvolio says is true, then that should work

$(".myDropdown").livequery("change", function () {
   // your event handler
}).livequery("keypress", function() { 
   $(this).trigger("change");
});

http://jsfiddle.net/tW6Su/2/ as proof

like image 175
Shikiryu Avatar answered Oct 17 '22 02:10

Shikiryu