Opened 15 years ago

Closed 15 years ago

#1406 closed defect (fixed)

window.onScroll event not firing when also connecting to a document.documentElement event

Reported by: [email protected] Owned by: alex
Priority: high Milestone: 0.9
Component: General Version: 0.2
Keywords: onscroll documentElement Cc:
Blocked By: Blocking:


When I connect to the window's onscroll event, it works just fine.

dojo.event.connect(window, "onscroll", function(){dojo.debug("Scrolling!");});

After attaching to an event on document.documentElement, then the onScroll stops working. There are several widgets that attach to the document.documentElement such as the FisheyeList? and causes onScrolls to stop working.

I don't believe the problem is in dojo.event.*, but it could be band-aided by adding some

This problem occurs in Firefox (Windows), Flock 0.7.1 (Windows), and Mozilla 1.7.12. Opera 9 (Windows) and Internet Explorer 7 work correctly.

A workaround involves changing instances of "document.documentElement" to "document".

I've attached an example. You may need to update the path to the dojo.js.

Attachments (1)

test.html (1.7 KB) - added by [email protected] 15 years ago.
onScroll bug

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by [email protected]

Attachment: test.html added

onScroll bug

comment:1 Changed 15 years ago by dylan

Owner: changed from anonymous to tk

comment:2 Changed 15 years ago by dylan


comment:3 Changed 15 years ago by bill

Owner: changed from tk to alex

comment:4 Changed 15 years ago by Jonathan Bond-Caron

This seems to be a bug in Firefox (tested with

The following test case reproduces, it has nothing to do with dojo:

function block() { }

document.documentElement.addEventListener("onscroll", block, false); window.addEventListener("onscroll", function() {alert('hey')}, false);

the window onscroll event never gets called, hopefully Bug189308 will be reopened:


comment:5 Changed 15 years ago by bill

Resolution: fixed
Status: newclosed

OK, checked over the 0.9 code (both dijit and dojox). Always connecting to "onscroll" on window so this isn't an issue anymore.

Note: See TracTickets for help on using tickets.