public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH yew-comp] wizard: fix page unlocking with advanced fields
@ 2026-05-28  9:18 Dominik Csapak
  2026-05-28 10:20 ` Thomas Lamprecht
  2026-05-28 11:17 ` applied: " Thomas Lamprecht
  0 siblings, 2 replies; 5+ messages in thread
From: Dominik Csapak @ 2026-05-28  9:18 UTC (permalink / raw)
  To: yew-devel

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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-28 11:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28  9:18 [PATCH yew-comp] wizard: fix page unlocking with advanced fields Dominik Csapak
2026-05-28 10:20 ` Thomas Lamprecht
2026-05-28 10:55   ` Dominik Csapak
2026-05-28 11:15     ` Thomas Lamprecht
2026-05-28 11:17 ` applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal