Wednesday, 20 February 2013

Focus/Blur event propagation

So I'm making a dynamic menu work better for keyboard users and just thought it'd take 10 mins to add device independent event handlers to the existing code. Did that, hit Ctrl+F5 a couple of times and nothing happend.

It turns out, not all events propagate, which when you think about it makes sense. I'm using YUI for this particular project so need the focus event module, if your hand rolling you'll need use the IE focusin/focusout events, and for everything else register your event listeners in the capturing phase, check it out on quirksmode.org.





 

No comments:

Post a Comment

 

Note: the opinions on this page don't represent that of my employer in anyway. And, actually only vaguely represent my opinions on the date of publication. (Unlike Ms T, I am very much for turning)