Opened 7 years ago

Closed 3 years ago

#15461 closed defect (patchwelcome)

dojox.layout.ScrollPane error with IE8

Reported by: cwlin0416 Owned by:
Priority: undecided Milestone: 1.13
Component: DojoX Layout Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

When i use IE8 place dojox.layout.ScrollPane? in TabContainer? and let ScrollPane? have scroll in first tab will cause an error. This error caused by the variable 'helpLineValue' at function _set() will get NaN in IE 8, dojo 1.6 and 1.7 both exists this problem.

I have fixed the problem as following, but it's temporary:

require([
	"dojox/layout/ScrollPane"
], function(ScrollPane) {
	dojo.declare("dojox.layout.MyScrollPane", [ dojox.layout.ScrollPane ], {
		_set: function(/* Float */n){
			if(!this._size){ return; }
			// summary: set the pane's scroll offset, and position the virtual scroll helper
			this.wrapper[this._scroll] = Math.floor(this._line.getValue(n));
			var helpLineValue = Math.floor(this._helpLine.getValue(n));

			// When the browser is IE8 helpLineValue will get NaN caused problem
			if( dojo.isIE == 8 && isNaN(helpLineValue)) {
				return;
			}
			dojo.style(this.helper, this._edge, Math.floor(this._helpLine.getValue(n)) + "px");
		}


	});
});

Change History (2)

comment:1 Changed 6 years ago by rolf

This issue is still around in 1.9.0, and is probably more critical than originally described.

It appears the n parameter for the _set function can be something other than a number when clicking within the scrollpane. Firefox and Chrome gracefully ignores the issue, but IE8 will normally fail. (If script debugging is activated it seems to work in IE too, but as most users don't have the developer console active that won't help much.)

Checking for isNaN(n) in _set will take care of it, but maybe it should be handled before _set is called?

comment:2 Changed 3 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 3+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.