Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7424 closed defect (fixed)

SplitContainer: occasionally stops being adjustable in Firefox (and thus sets its width cookie to "NaN" which makes it even more unusable on reload)

Reported by: mrblakwell Owned by:
Priority: high Milestone: 1.2
Component: Dijit Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

This is intermittent - sometimes happens right after load, sometimes requires 10+ adjustments to the splitter to cause it to happen

Digging deeper into the code, it seems that it is caused by an event that doesn't have its offsetX/Y properties set. This causes the computation of the screenToClientOffset to be NaN which in turn causes other values to be NaN and results in the resize handle responding to drags, but not actually moving as its position is NaN

Attachments (1)

splitContainerDiff (884 bytes) - added by mrblakwell 11 years ago.
This is a better fix

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by mrblakwell

i also noticed this:

var client = (e.layerY ? e.layerY : e.offsetY);

but if you look in _fixEvent - you see that evt.layerX = evt.offsetX; evt.layerY = evt.offsetY;

so this seems redundant as the events that end up here are created using dojo so should have gone through _fixEvent already...

comment:2 Changed 11 years ago by bill

Summary: SplitContainer occasionally stops being adjustable in Firefox (and thus sets its width cookie to "NaN" which makes it even more unusable on reload)SplitContainer: occasionally stops being adjustable in Firefox (and thus sets its width cookie to "NaN" which makes it even more unusable on reload)

See #7425 base bug. Apparently a problem with events (or rather events on FF3), but no way to know for sure w/out more investigation.

comment:3 Changed 11 years ago by Adam Peller

SplitContainer? was always prone to problems like this. I think we ended up wontfix'ing a bunch of similar bugs when we deprecated it, but if we're confident in a patch we could apply it.

Changed 11 years ago by mrblakwell

Attachment: splitContainerDiff added

This is a better fix

comment:4 Changed 11 years ago by mrblakwell

upon further exploration, it seems that it is not the event with the problem, but the SplitContainer? code. in particular, this line (and it's vertical counterpart):

var client = (e.layerX ? e.layerX : e.offsetX);

will try to set client as e.offsetX when e.layerX is 0 and in firefox, there is no e.offsetX so it is undefined which leads to the splitter dying and the cookie being set to NaN because integer - undefined = NaN

comment:5 Changed 11 years ago by bartlebooth

I'm experiencing the same problem here, also on FF3. I've locally created a workaround by changing the line to

var client = (e.layerX ? e.layerX : (e.offsetX ? e.offsetX : 0));

comment:6 Changed 11 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [14892]) workaround to avoid NaN values, but code is still suspect (and deprecated). Fixes #7424 !strict

comment:7 Changed 11 years ago by bill

FWIW dojo seems to normalize everything to use layerX/layerY so it could just reference that. See event.js line 293.

comment:8 Changed 11 years ago by bill

Milestone: tbd1.2
Note: See TracTickets for help on using tickets.