jquery - IE7 change event not being triggered -


am doing wrong? why isn't click event registering on first keydown?

http://jsfiddle.net/vol7ron/vj5cx/

in example,

  1. click "menu" make sure has focus
  2. use arrow keys (up/down) highlight option
  3. use spacebar select option

notice how change() event not being called. use spacebar again select same option , notice working should.


i've tried:

  • using blur/focus according this question, haven't had luck
  • setting checked attribute false, make sure change event triggered

interesting findings:

  • there isn't problem when using mouse (it triggers change event on first time, expected)
  • the problem still occurs keydown, after selecting mouse (run, click option, hover option , use keyboard).

expected results:

  • using keyboard navigation (up/down arrows) , selecting spacebar, should trigger both "keydown" , "click" log. doesn't work on initial keydown, every subsequent time. (check firefox working example)

i using blur/focus on initial load. apparently needed blur/focus inside keydown event:

if (e.keycode == 13 || e.keycode == 32) {    var cb = container.find('label.x-hover input:checkbox');     cb.blur();             // <-- added    cb.focus();            // <-- added    cb.click();      updatelog('keydown');    otitle.focus();          return false; } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -