Last Updated: February 25, 2016
·
1.784K
· nickeyz

focus event.relatedTarget the Firefox way (no way)

If you happen to handle an event via a jQuery focus event handler and wanting to know where the focus went?

Hello event.relatedTarget!

Now you're in clouds of joy and happines, flying softly over your app code, doing amazing things... Until the Firefox Boeing Jumbojet hits you on your forehead and you fall down, wingless and suffering.

Firefox event object has a relatedTarget property, which always stays null.

Seems to be a known issue (https://bugzilla.mozilla.org/show_bug.cgi?id=962251), waiting for W3C specs to clarify (http://www.w3.org/TR/DOM-Level-2-Events/events.html).

Hopefully soon we can fly again..