[pve-devel] [PATCH manager 4/7] ui: VMSelector: correctly change invalid class on en/disable

Thomas Lamprecht t.lamprecht at proxmox.com
Sat Mar 11 18:34:09 CET 2023


Am 06/03/2023 um 15:23 schrieb Dominik Csapak:
> since we manually handle the invalid class, we have to manually trigger
> that on setDisabled
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/form/VMSelector.js | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/form/VMSelector.js b/www/manager6/form/VMSelector.js
> index fb54e4835..399c4e658 100644
> --- a/www/manager6/form/VMSelector.js
> +++ b/www/manager6/form/VMSelector.js
> @@ -140,6 +140,8 @@ Ext.define('PVE.form.VMSelector', {
>  	} else {
>  	    sm.deselectAll();
>  	}
> +	// to correctly trigger invalid class
> +	me.getErrors();
>      },
>  
>      setValue: function(value) {
> @@ -163,7 +165,7 @@ Ext.define('PVE.form.VMSelector', {
>  
>      getErrors: function(value) {
>  	let me = this;
> -	if (me.allowBlank === false &&
> +	if (!me.isDisabled() && me.allowBlank === false &&

while at it you could have changed the odd `allowBlank === false` to just `!allowBlank` ;-)





More information about the pve-devel mailing list