From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: j.theisen@proxmox.com
Cc: e.huhsovitz@proxmox.com, pve-devel@lists.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 [thread overview]
Message-ID: <20260805135256.164189-1-e.huhsovitz@proxmox.com> (raw)
In-Reply-To: <73bc945e-f210-4a98-abfc-5a2c69763ef4@proxmox.com>
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 <e.huhsovitz@proxmox.com>
---
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
prev parent reply other threads:[~2026-08-05 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 11:05 [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default Jonas Theisen
2026-08-05 8:49 ` Elias Huhsovitz
2026-08-05 10:03 ` Jonas Theisen
2026-08-05 13:52 ` Elias Huhsovitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805135256.164189-1-e.huhsovitz@proxmox.com \
--to=e.huhsovitz@proxmox.com \
--cc=j.theisen@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox