BUG?: event drag not accounting for scroll height in FF

I wasn’t sure how I might register a potential bug, so I thought I’d post it here with my possible fix:

Details of Event:
Browser: FireFox
Scheduler View: month
Activity: Dragging events around the month
Description:
I had a problem recently whereby if I scrolled down the page and then starting dragging an event, the event would pop up to the same day of the first week.

After lots of debugging I discovered that the scheduler._mouse_coords function is not taking scroll height into account (although it is for IE).

So, this line:

pos.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els["dhx_cal_data"][0].scrollTop;

was removing too much from pos.y. When pos.y was translated into a date further down the function it had to defer to the earliest week because pos.y wasn’t even on the calendar.

Fix:
My workaround was to change this:

	if (!_isIE && (ev.pageX || ev.pageY))
	    pos={x:ev.pageX, y:ev.pageY};
	else pos={
	    x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft,
	    y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop
	};

to this:

if (!_isIE && (ev.pageX || ev.pageY)) pos={x:ev.pageX, y:ev.pageY + window.pageYOffset}; else pos={ x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft, y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop };

Note: It’s entirely possible that the X coord would need modifying as well, although people are less likely to lay their scheduler out on a page where they’d need to scroll right to get to events.

Just thought someone at dhtmlx might want to know :slight_smile:

PS: this is my first forum post, and I’d like to say that we LOVE dhtmlxScheduler!

Thanks for the problem report.
We can confirm the issue, fix will be included in the next update.

Great! I’ve also noticed the same effect on tooltips. The tooltips in the year view are showing lower than the they should when scroll is applied.

Tooltips everywhere else don’t even show, but I think that’s because I’ve got my scheduler operating in an iframe on the page, because the style is incompatible with Foundation CSS Framework (Zurb Foundation).

Will these be fixed as well?