Open
Bug 1084196
Opened 10 years ago
Updated 2 years ago
mouseenter event does not fire on <button> and its descendants
Categories
(Core :: Layout, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: mail, Unassigned)
References
()
Details
(Keywords: testcase)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
Steps to reproduce:
Added "mouseenter" event listener to a <div> element nested in a <button>
http://jsfiddle.net/ickata/u3bwqv4a/
Actual results:
The event does not fire on mouse enter.
Expected results:
The event must fire.
Reporter | ||
Updated•10 years ago
|
Comment 1•10 years ago
|
||
It is not really expected to fire inside <button>, at least in Gecko. the contents of <button> shouldn't really be visible for the hit testing..
(But I don't recall this being defined properly anywhere. HTML4 spec used to say something about this vaguely and IIRC that is the reason for Gecko's current behavior. Blink has some different behavior.)
Reporter | ||
Comment 2•10 years ago
|
||
All other major browsers support this. Even IE 7 supports this. Firefox is the only browser which does not support it, that's why I submitted this bug.
In general I see no reason not to support mouseenter inside <button>. After all - this is idea of the <button> element - to let me have whatever I want inside it.
Comment 3•10 years ago
|
||
What is the idea of the <button>? I thought the idea is to have a button to contain random content, like images, yet behave as a button (somewhat similar to <input type="button">).
Reporter | ||
Comment 4•10 years ago
|
||
It may wrap images, divs, etc., anything which I can style and make my buttons look fancy.
We have a software that allows our users to create fancy buttons inside a WYSIWYG editor. These buttons are complex HTML structured elements (divs, spans, etc.). The user may link them to internal/external pages (the editor wraps them in <a> tag), or make them submit a form (the editor wraps them in a <button>).
As I said, these "buttons" are fancy and have nice mouse-over effects. That's why I need "mouseenter", that's why I have to attach it to the button's root <div> element (as I don't know how that button will be used).
Right now I have to apply some dirty patches for Firefox only. I don't see a reason not to fix this issue - all other browsers support it.
Comment 5•10 years ago
|
||
This is all about hit testing which is mostly about layout.
Component: DOM: Events → Layout
I think this is a duplicate of bug 1089326.
Reporter | ||
Comment 8•6 years ago
|
||
Well, if they both describe the same issue then bug 1089326 is duplicate of this one because it was added later ;)
Updated•6 years ago
|
Summary: mouseenter event does not fire on <button> and it's descendants → mouseenter event does not fire on <button> and its descendants
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•