Ticket #1875 (new defect)

Opened 2 months ago

Last modified 1 week ago

Calendar Picker javascript gets position wrong when scrolled in IE7

Reported by: nickmurdoch Assigned to: anonymous
Priority: normal Milestone: 1.0.x bugfix
Component: Widgets Version: 1.0.4.4
Severity: normal Keywords:
Cc:

Description

Hi all,

I've been writing out pages using Genshi's xhtml renderer, which I beleive is triggering a bug in the Calendar.js for IE, due to IE's broken document.body.scrollTop attribute. Googling seems to suggest using document.documentElement.scrollTop instead.

I'm not quite sure how to include diffs of a compacted JavaScript? file where everything's on one line, but the clause in question is

if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}

which starts on line 14, character 26081. Changing it to the following makes it work:

if(Calendar.is_ie){br.y+=document.documentElement.scrollTop;br.x+=document.documentElement.scrollLeft;}

This seems to be the problem if Genshi is outputting HTML or XHTML -- possibly a bug in IE if it's in standards-compliant mode?

Change History

06/26/08 10:29:27 changed by nickmurdoch

(Forgot to mention what the actual problem is -- the pop-up Calendar displays in the wrong place if the user is scrolled down, even off the top of the visible viewpane if they're scrolled down enough)

08/21/08 21:49:10 changed by Chris Arndt

@nickmurdoch: I don't quite understand you explanation of the symptom. Can you provide a screenshot, maybe?

Can somebody on Windows with an IE7 confirm that the suggested fix works?

08/22/08 08:23:54 changed by nickmurdoch

Hi Chris,

http://zoidberg.nevira.net/~flexo/stuff/calendarwidgetbug.png is a screenshot I took of the website in question -- sorry it's mostly blurred out; it's a customer's site. In the screenshot, I'd clicked the bottom-most 'Choose' button on the page.

If I scroll down further and click 'Choose' again, the calendar widget appears progressively further up the page until it disappears off the top.

I'm using genshi as the rendering engine, with genshi.default_doctype left commented out in the config file. The header generated for the page is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

...

The content-type served is: "Content-Type: text/html; charset=utf-8"