From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 83DC01FF13C for ; Thu, 28 May 2026 11:18:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 47EB8FEA2; Thu, 28 May 2026 11:18:55 +0200 (CEST) From: Dominik Csapak 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 Message-ID: <20260528091851.1424576-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [wizard.rs] Message-ID-Hash: ODUQI5BTDKDVM4Q6EL7EKZHKGBFLQ33N X-Message-ID-Hash: ODUQI5BTDKDVM4Q6EL7EKZHKGBFLQ33N 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: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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