mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-29 08:40:44 +00:00
form: combo grid: clarify that showClearTrigger cannot actively hide them
As getting a good setting name is a bit hard here, the current one might me interpreted such that setting it to false will always hide the trigger, but that's not the case, this is mostly a "force show trigger even if allowBlank is set to false", and that's a bit of a long name ;-) So just add a comment and reevaluate if this really causes confusion. While at it simplify the boolean expression to make it shorter and easier to read. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4bee6fb074
commit
36d167d629
@ -32,6 +32,8 @@ Ext.define('Proxmox.form.ComboGrid', {
|
||||
notFoundIsValid: false,
|
||||
deleteEmpty: false,
|
||||
errorHeight: 100,
|
||||
// NOTE: the trigger will always be shown if allowBlank is true, setting showClearTrigger
|
||||
// to false cannot change that
|
||||
showClearTrigger: false,
|
||||
},
|
||||
|
||||
@ -55,10 +57,7 @@ Ext.define('Proxmox.form.ComboGrid', {
|
||||
setValue: function(value) {
|
||||
let me = this;
|
||||
let empty = Ext.isArray(value) ? !value.length : !value;
|
||||
me.triggers.clear.setVisible(
|
||||
(!empty && me.allowBlank) ||
|
||||
(!empty && me.showClearTrigger),
|
||||
);
|
||||
me.triggers.clear.setVisible(!empty && (me.allowBlank || me.showClearTrigger));
|
||||
return me.callParent([value]);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user