PDA

View Full Version : [OPEN][PR3] Ext.form.ComboBox errors when using ENTER to select an item in the list



jlmorgan
9 Mar 2011, 11:59 AM
Using standard typeAhead in a ComboBox with state data, start typing 'Alab' and receive the following error:



me.dom.className is undefined
http://localhost/ext-4.0-pr3/ext-core-debug.js
Line 10246


Source File: src/core/dom/Element.style.js



addCls : function(className){
var me = this,
cls = [],
space = ((me.dom.className.replace(trimRe, '') == '') ? "" : " "),
i, len, v;
if (!Ext.isDefined(className)) {
return me;
}
// Separate case is for speed
if (!Ext.isArray(className)) {
if (typeof className === 'string') {
className = className.replace(trimRe, '').split(spacesRe);
if (className.length === 1) {
className = className[0];
if (!me.hasCls(className)) {
me.dom.className += space + className;
}
} else {
this.addCls(className);
}
}
} else {
for (i = 0, len = className.length; i < len; i++) {
v = className[i];
if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) {
cls.push(v);
}
}
if (cls.length) {
me.dom.className += space + cls.join(" ");
}
}
return me;
}

jlmorgan
9 Mar 2011, 12:18 PM
With some simplified testing, I am able to recreate using the following code:



{
displayField: 'name',
fieldLabel: 'Test',
store: new Ext.data.ArrayStore({
data: [
['1','Alabama'],
['2','Alaska']
],
fields: ['id', 'name']
}),
triggerAction: 'all',
typeAhead: true,
valueField: 'id',
xtype: 'combo'
}


Actions to recreate:
1) Click inside field to gain cursor and focus
2) Type 'Alab'
3) Wait for expand with 'Alabama' already highlighted
4) Press ENTER
5) 'Alab' should appear with 'ama' as well, but also selected
6) Press BACKSPACE until 'bama' are removed
7) Press 's' to have 'Alas' as the value
8) Wait for expand
9) Expansion occurs
10) Error is proc'd
11) Collapse occurs immediately after