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 20B3C1FF12C for ; Wed, 05 Aug 2026 15:53:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C7C0321959; Wed, 05 Aug 2026 15:53:28 +0200 (CEST) From: Elias Huhsovitz To: j.theisen@proxmox.com Subject: Re: [PATCH manager] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field Date: Wed, 5 Aug 2026 15:52:56 +0200 Message-ID: <20260805135256.164189-1-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <73bc945e-f210-4a98-abfc-5a2c69763ef4@proxmox.com> References: <73bc945e-f210-4a98-abfc-5a2c69763ef4@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785937990715 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.101 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_LOW -0.7 Sender listed at https://www.dnswl.org/, low 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: BHBNRFDRSHSK36Y4SK4GQ7XP5RTLHDF7 X-Message-ID-Hash: BHBNRFDRSHSK36Y4SK4GQ7XP5RTLHDF7 X-MailFrom: e.huhsovitz@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 CC: e.huhsovitz@proxmox.com, pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The `autoSelect` configuration in `DiskStorageSelector` relies on the underlying `ComboGrid` store's `load` event to select the first available storage. When the field is disabled and subsequently re-enabled, the `load` event does not fire again. Consequently, the field remains empty despite `autoSelect` being configured. Fix this by explicitly handling the auto-selection logic inside the `setDisabled` method. When the field is being enabled and is currently empty, select the first record from the cached store. Signed-off-by: Elias Huhsovitz --- My knowledge of javacsript is also very limited, but this small patch is how i would fix this. TL;DR: The original code only triggered autoSelect when the storage list downloaded from the server. Toggling the checkbox does not trigger a new download, so the event never fired again. The fix intercepts the exact moment the field turns back on. It manually grabs the first storage from the browser's existing memory cache and sets it immediately. Let me know what you think of this approach. Note: I also noticed that your commit message has a typo. "Pupulate" -> "Populate" www/manager6/form/DiskStorageSelector.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/manager6/form/DiskStorageSelector.js b/www/manager6/form/DiskStorageSelector.js index 696f9033..f0af07ec 100644 --- a/www/manager6/form/DiskStorageSelector.js +++ b/www/manager6/form/DiskStorageSelector.js @@ -117,6 +117,11 @@ Ext.define('PVE.form.DiskStorageSelector', { // reset on disable if (value) { hdstorage.setValue(); + } else if (me.autoSelect && !hdstorage.getValue()) { + let rec = hdstorage.getStore().first(); + if (rec && rec.data) { + hdstorage.setValue(rec.data[hdstorage.valueField], true); + } } hdstorage.setDisabled(value); -- 2.47.3