From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 46C8A1FF0DF for ; Thu, 05 Nov 2026 13:54:55 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 93A7B216AC; Thu, 05 Nov 2026 13:54:29 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager 1/4] ui: form: list field: don't modify the class definition Date: Thu, 5 Nov 2026 13:53:18 +0100 Message-ID: <20261105125423.3788112-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261105125423.3788112-1-d.csapak@proxmox.com> References: <20261105125423.3788112-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.317 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UFK7Q5CF6KVA3XOJOL37R5BUIQFJ7Y4L X-Message-ID-Hash: UFK7Q5CF6KVA3XOJOL37R5BUIQFJ7Y4L X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Modifying a property defined on the class level modifies the prototype of that class. This can have unintended consequences when only part of the config is used in some widgets. This can be seen here with the `Registered Tags` and `User Tag Access` lists: One has no emptytext while the other does. Opening them in an alternating fashion adds the empty text from one to the other. Fix it by constructing the initial items list in initComponent, and let the widget modify that instead. Signed-off-by: Dominik Csapak --- www/manager6/form/ListField.js | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/www/manager6/form/ListField.js b/www/manager6/form/ListField.js index 49651bc5..6fcbdfd8 100644 --- a/www/manager6/form/ListField.js +++ b/www/manager6/form/ListField.js @@ -124,34 +124,34 @@ Ext.define('PVE.form.ListField', { }, }, - items: [ - { - xtype: 'grid', - reference: 'grid', + initComponent: function () { + let me = this; - viewConfig: { - deferEmptyText: false, - }, + me.items = [ + { + xtype: 'grid', + reference: 'grid', - store: { - listeners: { - update: function () { - this.commitChanges(); + viewConfig: { + deferEmptyText: false, + }, + + store: { + listeners: { + update: function () { + this.commitChanges(); + }, }, }, }, - }, - { - xtype: 'button', - text: gettext('Add'), - iconCls: 'fa fa-plus-circle', - handler: 'addLine', - margin: '5 0 0 0', - }, - ], - - initComponent: function () { - let me = this; + { + xtype: 'button', + text: gettext('Add'), + iconCls: 'fa fa-plus-circle', + handler: 'addLine', + margin: '5 0 0 0', + }, + ]; for (const [key, value] of Object.entries(me.gridConfig ?? {})) { me.items[0][key] = value; -- 2.47.3