Opened 13 years ago

Closed 12 years ago

#1406 closed defect (fixed)

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

Reported by: chris@… Owned by: alex
Priority: high Milestone: 0.9
Component: General Version: 0.2
Keywords: onscroll documentElement Cc:
Blocked By: Blocking:

Description

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 1.5.0.6 (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 chris@… 13 years ago.
onScroll bug

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by chris@…

Attachment: test.html added

onScroll bug

comment:1 Changed 13 years ago by dylan

Owner: changed from anonymous to tk

comment:2 Changed 13 years ago by dylan

Milestone: 0.40.4.1

comment:3 Changed 13 years ago by bill

Milestone: 0.4.10.5
Owner: changed from tk to alex

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

This seems to be a bug in Firefox (tested with 1.5.0.8)

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:

http://www.gtalbot.org/BugzillaSection/Bug189308_ScrollEvent.html

jon

comment:5 Changed 12 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.