P
Peter Wright
Hi all.
Hopefully this should demonstrate the problem I'm having:
http://flooble.net/~pete/focus-problem-demo/
(I'm testing it in Mozilla only, but I'm not sure if it's actually a
Mozilla-only problem)
I'm capturing the focus and blur events for the document, updating a
global Javascript variable to keep track of the "currently focussed"
element.
The problem is that it just doesn't seem to work for text (or
textarea) input elements. Just about anything else, no problem, but
not text or textarea.
You can see by switching focus (eg. by tabbing) through the five input
elements. Entering/leaving the button, checkbox or select elements
generates a focus/blur event. Entering/leaving the text/textarea
elements generates absolutely nothing.
Can anyone suggest what's wrong with this picture? Is it a browser
bug or am I fundamentally misunderstanding something about tracking
element focus?
Any help greatly appreciated.
Pete.
PS. I'd just like to mention that tracking focus bugs is hell when
just about everything you do changes the focus.
Hopefully this should demonstrate the problem I'm having:
http://flooble.net/~pete/focus-problem-demo/
(I'm testing it in Mozilla only, but I'm not sure if it's actually a
Mozilla-only problem)
I'm capturing the focus and blur events for the document, updating a
global Javascript variable to keep track of the "currently focussed"
element.
The problem is that it just doesn't seem to work for text (or
textarea) input elements. Just about anything else, no problem, but
not text or textarea.
You can see by switching focus (eg. by tabbing) through the five input
elements. Entering/leaving the button, checkbox or select elements
generates a focus/blur event. Entering/leaving the text/textarea
elements generates absolutely nothing.
Can anyone suggest what's wrong with this picture? Is it a browser
bug or am I fundamentally misunderstanding something about tracking
element focus?
Any help greatly appreciated.
Pete.
PS. I'd just like to mention that tracking focus bugs is hell when
just about everything you do changes the focus.