Side navigation
#7359 closed enhancement (wontfix)
Opened October 30, 2010 02:25PM UTC
Closed November 05, 2010 01:53AM UTC
Last modified March 10, 2012 11:59AM UTC
Cannot detect mouse position over a disabled field in Firefox
Reported by: | jason_lau@live.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | event | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Seems I can't detect the mouseX or mouseY while over a disabled form field. Works in IE, but not Firefox.
Attachments (0)
Change History (15)
Changed October 30, 2010 09:34PM UTC by comment:1
_comment0: | This isn't a jQuery bug IMO. \ \ It works in IE and Opera but doesn't in Firefox and Chrome (so I guess it also won't work in Safari). \ \ Without digging to deep I found this oooold [https://bugzilla.mozilla.org/show_bug.cgi?id=218093 bug report] for FF. But from the looks of it this will never ever be fixed. \ \ So it seems like you hit a specific behavior which varies between browsers. FF and Chrome don't accept/generate/pass-on any mouse-events when over a disabled element. While Opera and IE do. \ \ ---- \ \ In case you really depend on this specific code working crossbrowser: \ \ This bug in FF also was a problem for the developer of Firebug (Firebug relies on mouse-events to know which element you want to inspect). They solved it by putting a proxy-div-overlays over the disabled elements. \ [http://code.google.com/p/fbug/issues/detail?id=190 Firebug bug report] and [http://code.google.com/p/fbug/source/detail?r=5087 solution] (css + js) \ \ ---- \ \ In case the original link becomes unavailable sometime I ported the [http://www.jsfiddle.net/jitter/VUVMt/ test case] to jsfiddle → 1288474536453939 |
---|
Changed October 31, 2010 12:57AM UTC by comment:2
resolution: | → wontfix |
---|---|
status: | new → closed |
Unfortunately, there really isn’t anything that jQuery can do about this. Not even using capturing works; both Firefox and WebKit just suck it into a big black hole of nothingness.
Changed October 31, 2010 02:08AM UTC by comment:3
Replying to [comment:2 snover]:
Unfortunately, there really isn’t anything that jQuery can do about this. Not even using capturing works; both Firefox and WebKit just suck it into a big black hole of nothingness.
I made a workaround that I think works in all browsers. If you would like to see - http://jsfiddle.net/Jason/Hg2SK/7/
Changed November 01, 2010 03:25PM UTC by comment:4
Replying to [comment:3 jason_lau@…]:
I made a workaround that I think works in all browsers. If you would like to see - http://jsfiddle.net/Jason/Hg2SK/7/
Excatly what I was talking about. A similar thing was done by the developer of Firebug. This works for me in FF and Chrome.
Changed November 01, 2010 05:41PM UTC by comment:5
component: | unfiled → event |
---|---|
keywords: | → needsreview |
priority: | undecided → low |
resolution: | wontfix |
status: | closed → reopened |
type: | bug → enhancement |
I'm changing this to an "enhancement" that is up for review.
Changed November 02, 2010 05:36PM UTC by comment:6
_comment0: | Replying to [comment:5 rwaldron]: \ > I'm changing this to an "enhancement" that is up for review. \ \ Hmm, I don't think this should become an enhancement to the jQuery Core. \ \ The proxy divs work well enough if you really need this. But I feel this to be too intrusive to include in general. \ \ A jQuery plugin IMO is the right way to handle this. → 1288720193728989 |
---|
Replying to [comment:5 rwaldron]:
I'm changing this to an "enhancement" that is up for review.
Hmm, I don't think this should become an enhancement to the jQuery Core.
The proxy divs work well enough if you really need this. But I feel this to be too intrusive to include it in general. A jQuery plugin IMO is the right way to handle this.
Also this only works if you want to catch the event high up in the DOM tree (document, body, html). It doesn't solve the problem of binding an event directly to the disabled element e.g. $("input:disabled").bind("mousemove", function() { ... })
won't work. For this the proxy divs would need to trigger the event-handler bound to the disabled element.
Changed November 02, 2010 06:13PM UTC by comment:7
My reasoning is that jQuery does provide cross-browser normalization for unexpected incompatibilities. I think this particular one should at least be discussed - if it is dismissed outright, that is certainly fine as well.
Changed November 02, 2010 09:07PM UTC by comment:9
#7379 is More evidence to support the discussion of adding workaround support for this issue.
Changed November 03, 2010 11:20PM UTC by comment:10
Changed November 04, 2010 06:27PM UTC by comment:11
To eliminate cross-browser behavior inconsistencies, I added a client-side-generated transparent gif to the overlay. For example, Internet Explorer could not detect a click on a disabled field, but Firefox could. The transparent image (1px x 1px scaled to 100% x 100%) filled the void of the empty container, I suppose. It's been tested in all browsers. http://jasonlau.biz/jquery.detectmouseoverdisabled/
Changed November 05, 2010 01:53AM UTC by comment:12
keywords: | needsreview |
---|---|
resolution: | → wontfix |
status: | reopened → closed |
A plugin seems like a great way to fix this, thanks jason_lau!
Changed November 05, 2010 02:12AM UTC by comment:13
@dmethvin +1!
@jason_lau - how about putting your work up on github :D
Changed November 06, 2010 03:58PM UTC by comment:14
@ rwaldron
Done. Thanks for the suggestion.
jasonlau at github.com
This isn't a jQuery bug IMO.
It works in IE and Opera but doesn't in Firefox and Chrome (so I guess it also won't work in Safari).
Without digging too deep I found this oooold bug report for FF. But from the looks of it this will never ever be fixed.
So it seems like you hit a specific behavior which varies between browsers. FF and Chrome don't accept/generate/pass-on any mouse-events when over a disabled element. While Opera and IE do.
In case you really depend on this specific code working crossbrowser:
This bug in FF also was a problem for the developer of Firebug (Firebug relies on mouse-events to know which element you want to inspect). They solved it by putting a proxy-div-overlays over the disabled elements.
Firebug bug report and solution (css + js)
In case the original link becomes unavailable sometime I ported the test case to jsfiddle