I register a click handler and a mouse down handler on a <div>
that contains other <div>
s. By default the inner <div>
is set to visibility: hidden
. In the mousedown
handler the visibility
is set to visible
.
The problem is that in Safari and Firefox the click handler does not fire the first time you click on the outer <div>
. In Chrome the click handler fires.
I have made a reduced test case: https://jsbin.com/hequku/edit?html,css,js,output
The interesting thing is, that if instead of manipulating the visibility
attribute you manipulate the opacity
attribute, the cross-browser differences go away.
What I am trying to figure out is:
- Is this something that is expected to be different between browsers? If not, what is the spec conforming behavior?
- Am I missing something about what one should and should not be able to do in
click
andmousedown
handlers?