all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [PATCH yew-comp] wizard: fix page unlocking with advanced fields
Date: Thu, 28 May 2026 11:18:45 +0200	[thread overview]
Message-ID: <20260528091851.1424576-1-d.csapak@proxmox.com> (raw)

The wizard depends on the form context validation of the pages to
determine which to lock and unlock. Initially all pages are locked and
only if the form_ctx changes and is valid the corresponding page will be
unlocked. With the introduction of the advanced button in the wizard,
this can happen for pages even if they're not rendered yet.

For pages that are by default invalid (e.g. includes a required field
that is empty at the start) this means the form_ctx will show is_valid
since none of the form fields are registered yet with it.

To prevent that, force all pages to render always, which will then
correctly update each form_ctx with the validation state. Performance
wise this must be OK, since when the user finished the wizard, all pages
must be rendered anyway (The tab panel doesn't 'unrender' already
rendered pages).

Fixes: 67d11b1 (wizard: auto-show the Advanced toggle on pages with advanced fields)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/wizard.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/wizard.rs b/src/wizard.rs
index 9091c52..3236e12 100644
--- a/src/wizard.rs
+++ b/src/wizard.rs
@@ -510,6 +510,9 @@ impl Component for PwtWizard {
         let mut tab_panel = TabPanel::new()
             .class(Overflow::Auto)
             .class(Flex::Fill)
+            // NOTE: this is necessary for the form_ctx validation to work correctly, since only
+            // rendered (and thus mounted) fields are registered with the context.
+            .force_render_all(true)
             .tab_bar_style(props.tab_bar_style)
             .selection(self.selection.clone());
 
-- 
2.47.3





             reply	other threads:[~2026-05-28  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  9:18 Dominik Csapak [this message]
2026-05-28 10:20 ` [PATCH yew-comp] wizard: fix page unlocking with advanced fields Thomas Lamprecht
2026-05-28 10:55   ` Dominik Csapak
2026-05-28 11:15     ` Thomas Lamprecht
2026-05-28 11:17 ` applied: " Thomas Lamprecht

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=20260528091851.1424576-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=yew-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal