Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397618

Summary: inputCompletion error in IE10
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 1.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2013-01-07 15:25:56 EST
When I run the navigator on IE10, there is an error in the InputCompletion.
Specifically at line 333, datalist is undefined so the loop below fails.

InputCompletion.prototype._proposeOnList = function(datalist, searchTerm, filterForMe){
		var categoryName = "";
		var categoryList = [];
		var searchTermLen = searchTerm ? searchTerm.length : 0;
		for(var i=0; i < datalist.length; i++){
Comment 1 Susan McCourt CLA 2013-01-07 15:32:36 EST
SCRIPT5007: Unable to get property 'length' of undefined or null reference 
inputCompletion.js, line 337 character 16
Comment 2 libing wang CLA 2013-01-24 16:41:01 EST
fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2308d25116c26ade6186c79b25efb332882aed6e.

The reason is that IE10 kicks the "input" event before "focus" event on a text field. We initialize the inputCompletion._dataList on focus event but input event handler tries to use it before hand.
The solution is to init the this._dataList in the constructor as []. So that when ever input event comes first it will just pass it to focus handler.