if (me.enableLoadMask) {
delete me.enableLoadMask;
- // if the picker exists,
- // we reset its minheight to the saved let/0
- // we have to update the layout, otherwise the height
- // gets not recalculated
+ // if the picker exists, we reset its minHeight to the previous saved one or 0
if (me.picker) {
me.picker.setMinHeight(me.savedMinHeight || 0);
Proxmox.Utils.setErrorMask(me.picker);
delete me.savedMinHeight;
+ // we have to update the layout, otherwise the height gets not recalculated
me.picker.updateLayout();
}
}
}
if (!found) {
- let rec = me.store.first();
- if (me.autoSelect && rec && rec.data) {
- def = rec.data[me.valueField];
- me.setValue(def, true);
- } else if (!me.allowBlank && !(Ext.isArray(def) ? def.length : def)) {
- me.setValue(def);
- if (!me.notFoundIsValid && !me.isDisabled()) {
- me.markInvalid(me.blankText);
+ if (!(Ext.isArray(def) ? def.length : def)) {
+ let rec = me.store.first();
+ if (me.autoSelect && rec && rec.data) {
+ def = rec.data[me.valueField];
+ me.setValue(def, true);
+ } else if (!me.allowBlank) {
+ me.setValue(def);
+ if (!me.isDisabled()) {
+ me.markInvalid(me.blankText);
+ }
}
+ } else if (!me.notFoundIsValid && !me.isDisabled()) {
+ me.markInvalid(gettext('Invalid Value'));
}
}
} else {