Opened 11 years ago
Closed 11 years ago
#11419 closed defect (duplicate)
SplitContainer: only resizes in FF 2 or 3 times before freezing
Reported by: | jpsykes | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit | Version: | 1.2.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
SlideContainer? widget in an implementation was being observed that it would resize 2-5 times and then just freeze. the bar was still clickable, but you couldn't drag it up or down, it just froze.
Attachments (1)
Change History (5)
comment:1 Changed 11 years ago by
comment:3 Changed 11 years ago by
Further info. It's fixed in the 1.4.3 version using this code.
if(this.isHorizontal){
var client = e.layerX e.offsetX 0; var screen = e.pageX; this.originPos = this.originPos.x;
}else{
var client = e.layerY e.offsetY 0; var screen = e.pageY; this.originPos = this.originPos.y;
}
comment:4 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Summary: | slideContainer only resizes in FF 2 or 3 times before freezing → SplitContainer: only resizes in FF 2 or 3 times before freezing |
Dup of #7424.
Note: See
TracTickets for help on using
tickets.
The issue is that in dijit.layout.SplitContainer?.beginSizing there are two tests for a variable, the test is looking for undefined, but rather than looking for typeof undefined, it just tests for foo. The problem occurs in that sometimes after a resize that value might be zero, zero is an accepted value, but gets interpreted as undefined, and the script falls to pieces. It results in a whole series of NaN's that prevent the slider from functioning again. A fix was found to be just changing:
--- Original Dojo 1.2.0 +++ Fix for split container freeze bug @@ -24,18 +24,16 @@
+ var client = (typeof e.layerX === 'undefined') ? e.offsetX : e.layerX;
+ var client = (typeof e.layerY === 'undefined') ? e.offsetY : e.layerY;
I know this is old and deprecated code, but I wanted to post it here incase someone else has a similar issue and came here to see if there was a solution.