[Project_owners] Using onfocus/onblur on editable menulists

Neil neil at parkwaycc.co.uk
Sun Jul 3 22:52:47 EDT 2005

David Murray wrote:

> Pretty much what the subject says. I have tried everything I can think 
> of to attach an onfocus/onblur to an editable menulist, but nothing 
> triggers it. Other event listeners seem to work (oninput, etc), but I 
> can't get onfocus or onblur to work. Has anybody ever gotten around this?

The onfocus and onblur events are special, they don't bubble, and don't 
apply to the editable menulist itself but to its anonymous HTML input. 
The textbox binding works around this (and I mean works around, because 
the event target is wrong) by inheriting the onfocus and onblur 
attributes. However the editable menulist does not do this, so if you 
are targetting trunk then you should file a bug to get it fixed, 
otherwise the other workaround is to use a capturing event listener, 
although you should be aware that calling .focus() on the editable 
menulist itself will generate two focus events.

More information about the Project_owners mailing list