Ext version tested:
Browser versions tested against: Description:
Make a combo box allowBlank: false. You can select a value and then delete it. Didn't used to work that way in older Ext versions.

Steps to reproduce the problem:
Created a fiddle here:


http://ift.tt/17hFdzm


To see the problem:



  1. Select a value from the drop down.

  2. Select the value.

  3. Delete the value.

  4. Now tab off.


Rather than selecting the value that was chosen, the combo is empty.

I suspect the problem is here:



Code:



assertValue: function() { var me = this,
value = me.getRawValue(),
rec, currentValue,
displayValue = me.getDisplayValue();


if (me.forceSelection) {
if (me.multiSelect) {
// For multiselect, check that the current displayed value matches the current
// selection, if it does not then revert to the most recent selection.
if (value !== displayValue) {
me.setRawValue(displayValue);
}
} else {
// For single-select, match the displayed value to a record and select it,
// if it does not match a record then revert to the most recent selection.
rec = me.findRecordByDisplay(value);
if (rec) {
currentValue = me.value;
// Prevent an issue where we have duplicate display values with
// different underlying values.
if (!me.findRecordByValue(currentValue)) {
me.select(rec, true);
}
} else if (me.lastSelection) {
me.setRawValue(displayValue);
}
}
}
me.collapse();

},

Specifically here


Code:



else if (me.lastSelection) {
me.setRawValue(displayValue);
}

Shouldn't we be doing a me.setValue(me.lastSelection) here?