neo
neo copied to clipboard
form.field.Select: onFocusLeave() no longer clearing values with forceSelection
The bug occured inside our client app and needs investigation.
The new logic seems wrong: if the widget is using the forceSelection config, non matching values need to get cleared. Without the config, arbitrary entries are allowed and must not get cleared.
onFocusLeave(data) {
let me = this;
if (!me.record) {
if (me.forceSelection) {
me.value = me.forceSelection ? me.activeRecordId : null;
}
// If we exit without selecting a record, clear the filter input value.
else {
me.getInputEl().value = '';
}
}
// Clear any typeahead hint
me.updateTypeAheadValue('');
// The VDOM must not carry the empty string permanently. Only while clearing the value.
if (!me.record && !me.forceSelection) {
delete me.getInputEl().value;
}
super.onFocusLeave(data)
}
@ExtAnimal
I think it is related to the change from hintRecordId to activeRecordId, which have a different purpose.
hint => the not selected record which matches via autoComplete
we now also have activeRecord and record, which have the same purpose.