Closed
Bug 354271
Opened 19 years ago
Closed 18 years ago
Observer not getting called
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: ole.ersoy, Unassigned)
Details
(Whiteboard: CLOSEME 2008-08-30)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7
Hi,
I'm coding a javascript button that has observers.
I have 2 onMouseDown obserers and 1 onMouseOut observer.
The onMouseOut observer just switches the images on the button.
The 2 mouse down observers create an alert onMouseDown.
If I hit escape upon seeing the first alert, the second alert appears.
However, if I move the mouse out of the focus area, triggering the onMouseOut
observer's notification, the second alert that I am expecting from the onMouseDown observer never happens.
I can send you the demo if you like.
Cheers,
- Ole
Reproducible: Always
Actual Results:
gfsdg
Expected Results:
asdfasf
fasdfas
Here are some code samples from the bug:
The listener method looks like this:
handleMouseDownEvent: function(/*Object*/ mouseDownEvent)
{
//alert(this.message);
domNode = mouseDownEvent.currentTarget;
},
It gets called whenever there is a mouse down on the button.
The object it belongs to is added to a button like this:
mouseDownListener1 = new dojo.presentation.listeners.MouseDownListener();
mouseDownListener2 = new dojo.presentation.listeners.MouseDownListener();
mouseDownListener1.message = "I'm so clicked dud";
mouseDownListener2.message = "Me to dud";
button.addMouseDownListener(mouseDownListener1);
button.addMouseDownListener(mouseDownListener2);
A click on the domNode is registered like this:
if (!component.isDisabled)
{
domNode.onmousedown = dojo.lang.hitch(domNode.componentReference, "notifyMouseDownListeners");
}
},
So the componentReference's, which is the button, notifyMouseDownListeners method gets called when a click occurs on the button.
If I leave the mouse cursor over the button, both alerts are triggered.
If I mouse the mouse to click "Ok" on the alert, the second alert is never triggered.
Oh - Incidentally - I do stop propagation on the event like this:
handleMouseDownEvent: function(/*Object*/ mouseDownEvent)
{
//alert(this.message);
domNode = mouseDownEvent.currentTarget;
mouseDownEvent.stopPropagation();
},
inside the listener method.
I cut it out of the original post for brevity.
Comment 3•19 years ago
|
||
Reporter, do you still see this problem with the latest Firefox 2? If not, can you please close this bug as WORKSFORME. Thanks!
Whiteboard: CLOSEME 07/09
Version: unspecified → 1.0 Branch
I'll just close it for now. I need to dig up the tests and run them again in 2.0. If there's any issue, I'll post back. Thanks,
- Ole
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Comment 5•19 years ago
|
||
I think we should leave this open for the time being then, since it's quite descriptive. Also, if the tests fail on Fx 2.0, could you then please try a firefox trunk build?
- http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
Thanks!
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Comment 6•18 years ago
|
||
Ole, can you make a testcase and upload it to this bug report using
the "Add an attachment" link please?
While we can try to paste something together from the snippets you
provided, there's still a risk we do it wrong...
Also, does the problem still occur in Firefox 3 ?
http://www.mozilla.com/firefox/
Whiteboard: CLOSEME 07/09 → CLOSEME 2008-08-30
Hi,
I think this can be safely closed now. It was most likely a bug in dojo.hitch. I have rewritten everything using dojo.connect and never had an issue.
This is DT (Different Topic), and I can open a different report for it if you think it's workable. Suppose I have a node A 100px X 100px and another node B 80px X 80px that is centered on top of node A. Suppose also that node A has a rollover listener that changes the background image onmouseenter and hides it onmouseleave.
I've noticed that if the mouse is moved over quickly out of node A the browser will not detect the onmouseleave event. So in order to be reasonably sure that onmouseover and onmouseout is detected, one has to make node B smaller.
I noticed this while experimenting with a grid where each grid item switches the background whenever the mouse is over it, and should switch back when the mouse leaves.
However if moving the mouse out of the dom node quickly the background never gets changed, and the background of the adjacent grid cell that the mouse is over does change so now 2 grid items have the same background, when only one is supposed to have the "Highlighted" background.
It seems like it should be possible to have an accounting structure for whether events that should have been fired, were fired. For example at point in time 1 we know that onmouseenter was fired for node A. At point in time 2 we know that we are over a node that has a mutually exclusive screen area from node A. However we also see that onmouseleave was never fired when we left node A....so we fire it.
Maybe a thread that runs and checks for event discrepancies every 100 milliseconds?
P.S. I'm using dojo's onmouseenter and onmouseleave support (Since FF 2.0 does not have support for these), but I don't think it's a dojo bug, since the event trigger depends on the rate / speed at which the mouse is moved over the target area.
Ole
Comment 8•18 years ago
|
||
Please file a separate bug for the issue above (if it occurs in Firefox 3
or newer) and include an example URL or upload a testcase. Thanks.
-> WORKSFORME
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago → 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•