Closed Bug 489667 Opened 16 years ago Closed 15 years ago

document.onmousedown grabs scrollbar mouse clicks

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: matt, Unassigned)

References

()

Details

Attachments

(1 file)

173 bytes, text/html
Details
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a1pre) Gecko/20090421 Minefield/3.6a1pre ID:20090421030958 If a top-level document has an onmousedown event handler, the handler will get called when the document's scroll bars are clicked, with an event.target.tagName of "HTML". In the example URL, this prevents simple clicks from working on the scrollbars, though dragging the scroll thumb still works.
This bug has broken the scroll bar in the Zimbra web client in Firefox 3.6. Here's a small test case to help repro: <html> <HEAD> <TITLE>Bug</TITLE> </HEAD> <SCRIPT TYPE="text/javascript"> document.onmousedown = function() { return false }; </SCRIPT> <BODY> <div style="height:1000px">Firefox. </div> <div style="height:1000px">Firefox. </div> <div style="height:1000px">Firefox. </div> </BODY> </HTML>
Regression range would be very useful. (Though, IMO the behavior that preventing default handling on mousedown disables click events on scrollbar makes sense. Unfortunately if that is not what web expects, the old behavior may be needed.)
One could also argue that you shouldn't be able to prevent default behavior for clicks on native controls like scrollbars (or selects, etc). Either way, the behavior has changed. The fix for affected elements in Zimbra was to make sure mousedown/mouseup return true and do not call preventDefault().
I'm also seeing this problem on OS X, new in FF 3.6. FWIW, the difference here is that with FF 3.5, returning false from a mousedown event would still allow the native controls to continue. The event code would still be triggered on the underlying DOM element, which seems a bit odd to me. In FF 3.6, returning false from a mousedown (and perhaps click?) event will fail the native controls.
Hi, this issue also exists for roundcube webmail's users. cf. http://trac.roundcube.net/ticket/1486472 And this is a very annoying one because... hey! because I read my emails with roundcube. :)
Attached file testcase
Bug 511075 should fix this
Depends on: 511075
Just confirmed that Firefox 3.6.4 beta no longer has the scrollbar issue in Zimbra 5.0.21. This bug can probably be marked a duplicate of 511075
Fixed with bug 511075.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: