mousedown within div hides div --> mouse can't do anything in content area




18 years ago
17 years ago


(Reporter: joakim, Assigned: joki (gone))



Windows 98

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [nsbeta2+], URL)


(3 attachments)



18 years ago
On I have a rather simple dropdown 
menu system using <div> tags that are initially invisible, but are made visible 
by calling some JavaScript. This generally works fine, but the <div>s that make 
up the menus each contain an image whose onMouseDown calls a piece of JavaScript 
to make the menu invisible again. When I click on this, the menu disappears as 
it should, but further clicks in the Mozilla window produce no results, 
including trying to mark text, following links, or the images with onMouseDown 

I'm fairly sure that this has to do with the clicked image being inside a <div>, 
since setting its onMouseDown to the same JavaScript function call as the 
top-level menu items (which work fine) produces the same insensitivity to 

Sorry about not producing a simpler test case, but I'm a bit pressed for time, 
and I have mucked around with this for a few hours already, trying to see if I 
was doing anything wrong.


18 years ago
Whiteboard: making testcase

Comment 1

18 years ago
Created attachment 7624 [details]
medium-sized testcase

Comment 2

18 years ago
Joakim, you're right about pretty much everything you said about this bug, 
especially the part about it being tough to nail down.

Additional things to notice:
- This bug only happens with onmousedown (not onclick or onmouseup).
- The div must have position:absolute for this bug to show up.
- It doesn't matter if div starts out as visible or hidden.
Ever confirmed: true
Keywords: testcase
Whiteboard: making testcase


18 years ago
QA Contact: gerardok → ckritzer

Comment 3

18 years ago
I just ran into this same bug, and have narrowed down the circumstances a bit. 
Here are the details I've discovered:

1). the problem indeed only occurs for mousedown
3). the problem occurs when you mousedown on any type of element, not just 
2). the problem occurs when, for the element you mousedown on, position: 
absolute OR position: relative.  position: static is not affected.
4). the problem occurs when you mousedown on a child element.  After that 
mousedown, it's ancestors will not be able to receive any mouse events
5). instead of ancestors receiving their own mouse events, they will all be 
targetted at the child element who first triggered the mousedown

I've put together a little test case to further illustrate the problem which 
I'll attach in a second

Comment 4

18 years ago
Created attachment 7674 [details]
fairly simple test case
Sounds like this one is yours joki, reassigning.
Assignee: jst → joki

Comment 6

18 years ago
Lucky for you, joki, this bug seems to be fixed in M15.  Woohoo!


18 years ago
Summary: Calling a JavaScript function onMouseDown on an image within a <div> makes clicks nonfunctional → mousedown within div hides div --> mouse can't do anything in content area

Comment 7

18 years ago
Created attachment 7887 [details]
testcase like first one, but shows the effect of _moving_ the div.

Comment 8

18 years ago
In the testcase I just added, mouse focus gets stolen when you click "move div" 
unless you move the mouse to put the mouseup inside the div.

Comment 9

18 years ago
nominating for nsbeta2 based on:
 - severity
 - visibility
 - major functionality broken
Keywords: nsbeta2

Comment 10

18 years ago
ckritzer, could you retest this to help PDT make a +/- call for beta2? Thanks.

Comment 11

18 years ago

Just retested on:
 - MacOS9 2000-05-04-08-M16 Commercial Build
 - Linux6 2000-05-04-08-M16 Commercial Build
 - Win98 2000-05-04-09-M16 Commercial Build

and here's what I've found:
- 3rd testcase works great on all platforms
- 2nd testcase still returns incorrect info
- 1st testcase appears to hang up event firing when you do the following steps:
  1) click on 'show div' text or 'show div' button
  2) when the div appears, click on the 'hide div' text
  3) div disappears, clicking on either group of text or buttons does not fire fact, you don't even get the visible button-press action (button 
does not "push down" like you would expect it to)...

So, the original bug/testcase still exists.

Comment 12

18 years ago
steps to reproduce bug using third testcase:
1. load
2. click "show div"
3. click "move div right" within the div (the part that just appeared)
4. try selecting "text outside div"

sorry for not giving steps earlier.. does the bug still not show up for you?

Comment 13

18 years ago
Putting on [nsbeta2+] radar for beta2 fix. 
Whiteboard: [nsbeta2+]

Comment 14

18 years ago
All three test cases work great for me right now on WinNT.  ckritzer, could you 
reverify the problem?  I checked in some stuff that may have impacted this right 
before 5/16.  I want to get this checked on another platform before I mark it 

Comment 15

18 years ago
works for me too (win98, 2000 052508)

Comment 16

18 years ago
Okay, I'm marking this worksforme.
Last Resolved: 18 years ago
Resolution: --- → WORKSFORME

Comment 17

18 years ago
- MacOS9 2000-06-01-20-M16 Commercial Build
- Linux6 2000-06-01-20-M16 Commercial Build
- Win98  2000-06-01-21-M16 Commercial Build
You need to log in before you can comment on or make changes to this bug.