From: Jonas Theisen <j.theisen@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager v2 2/2] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field
Date: Thu, 6 Aug 2026 15:01:30 +0200 [thread overview]
Message-ID: <20260806130152.207884-3-j.theisen@proxmox.com> (raw)
In-Reply-To: <20260806130152.207884-1-j.theisen@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.
Contributed-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
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-06 13:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 13:01 [PATCH pve-manager v2 0/2] ui: vm create: populate EFI and Jonas Theisen
2026-08-06 13:01 ` [PATCH pve-manager v2 1/2] ui: vm create: populate EFI and TPM storage by default Jonas Theisen
2026-08-06 13:01 ` Jonas Theisen [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=20260806130152.207884-3-j.theisen@proxmox.com \
--to=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