From: "Shan Shaji" <s.shaji@proxmox.com>
To: "Azharul Haque" <haque@azharul.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH login-manager v3 5/5] fix #4281: ui: fix stale Continue button state on realm switch
Date: Wed, 26 Aug 2026 12:24:52 +0200 [thread overview]
Message-ID: <DKYSWGTHSUK1.1CDZQ1USIJBCX@proxmox.com> (raw)
In-Reply-To: <20260821034147.30194-8-haque@azharul.com>
On Fri Aug 21, 2026 at 5:41 AM CEST, Azharul Haque wrote:
> Form(onChanged: ...) revalidates against whatever fields are
> currently mounted at the moment a FormField's own value changes.
> For the realm dropdown that runs before the following rebuild
> adds/removes the username/password fields for the newly selected
> realm's type, so Continue got enabled/disabled based on the
> outgoing realm's field set rather than the incoming one. Most
> visibly, switching from an OpenID realm to a password realm left
> Continue enabled with both fields empty, only failing validation
> once actually pressed.
>
> Recompute _submitButtonEnabled explicitly in onDomainChanged instead:
> OpenID realms have nothing to validate, so enable it directly; other
> realms are revalidated in a post-frame callback once the rebuild has
> settled. Do the same after the initial realm auto-selection in
> _getAccessDomains(), in case the default realm is an OpenID one.
>
> Signed-off-by: Azharul Haque <haque@azharul.com>
> ---
> lib/proxmox_login_form.dart | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
[snip]
> @@ -868,6 +893,9 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
> setState(() {
> _progressModel.inProgress -= 1;
> _selectedDomain = selection;
> + // An OpenID realm has no username/password to fill in, so there's
> + // nothing for the form to validate before Continue is usable.
> + _submitButtonEnabled = selection?.isOpenIdRealm == true;
If I fill in the origin field and the SSL validation enabled, then press the
Continue button, the dialog is shown and the Continue button becomes
disabled. I have to edit the field again to re-enable the Continue button,
even though the form is valid.
That is, if selection is null, the button becomes disabled. As I understand
it, we also need to check whether selection is null before setting the
button state here:
```
if (selection != null) {
_submitButtonEnabled = selection!.isOpenIdRealm == true;
}
```
Why use an if block instead of an inline check? Otherwise, the
submitButtonEnabled state variable is assigned false, which notifies the
framework that the object’s internal state has changed and needs to be
rebuilt. Because of this rebuild, the button becomes disabled.
> });
>
> return response;
next prev parent reply other threads:[~2026-08-26 10:24 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:40 [PATCH 0/2] android: register OpenID Connect callback activity for #4281 Azharul Haque
2026-08-10 5:40 ` [PATCH 1/2] fix #4281: android: register OpenID Connect callback activity Azharul Haque
2026-08-10 5:40 ` [PATCH 2/2] fix #4281: android: match renamed OpenID callback scheme Azharul Haque
2026-08-10 13:59 ` [PATCH 0/2] android: register OpenID Connect callback activity for #4281 Shan Shaji
2026-08-10 14:47 ` [PATCH v2 0/7] app: implement OpenID Connect (OAuth) realm login (#4281) Azharul Haque
2026-08-10 14:47 ` [PATCH dart-api-client v2 1/2] fix #4281: access: add `type` property to `PveAccessDomainModel` Azharul Haque
2026-08-20 9:17 ` Shan Shaji
2026-08-20 13:37 ` Azharul Haque
2026-08-20 14:39 ` Shan Shaji
2026-08-21 2:56 ` Azharul Haque
2026-08-21 8:00 ` Shan Shaji
2026-08-10 14:47 ` [PATCH dart-api-client v2 2/2] fix #4281: access: add OpenID Connect auth-url/login helpers Azharul Haque
2026-08-20 9:48 ` Shan Shaji
2026-08-20 13:41 ` Azharul Haque
2026-08-10 14:47 ` [PATCH login-manager v2 1/3] fix #4281: ui: add OpenID Connect login flow to login form Azharul Haque
2026-08-20 12:31 ` Shan Shaji
2026-08-10 14:47 ` [PATCH login-manager v2 2/3] fix #4281: ui: fix stale Continue button state on realm switch Azharul Haque
2026-08-10 14:47 ` [PATCH login-manager v2 3/3] fix #4281: ui: use a namespaced OpenID callback scheme Azharul Haque
2026-08-20 14:28 ` Shan Shaji
2026-08-10 14:47 ` [PATCH flutter-frontend v2 1/2] fix #4281: android: register OpenID Connect callback activity Azharul Haque
2026-08-20 14:01 ` Shan Shaji
2026-08-10 14:47 ` [PATCH flutter-frontend v2 2/2] fix #4281: android: match renamed OpenID callback scheme Azharul Haque
2026-08-21 3:41 ` [PATCH v3 00/10] app: implement OpenID Connect (OAuth) realm login (#4281) Azharul Haque
2026-08-21 3:41 ` [PATCH dart-api-client v3 1/2] fix #4281: access: add `type` property to `PveAccessDomainModel` Azharul Haque
2026-08-21 3:41 ` [PATCH dart-api-client v3 2/2] fix #4281: access: add OpenID Connect auth-url/login helpers Azharul Haque
2026-08-26 12:49 ` Shan Shaji
2026-08-21 3:41 ` [PATCH login-manager v3 1/5] fix #4281: deps: add flutter_web_auth_2 dependency Azharul Haque
2026-08-21 3:41 ` [PATCH login-manager v3 2/5] refactor: ui: factor out shared login tail into _finishLogin Azharul Haque
2026-08-26 13:41 ` Shan Shaji
2026-08-21 3:41 ` [PATCH login-manager v3 3/5] refactor: ui: split password form into its own widget Azharul Haque
2026-08-26 9:32 ` Shan Shaji
2026-08-21 3:41 ` [PATCH login-manager v3 4/5] fix #4281: ui: add OpenID Connect login flow to login form Azharul Haque
2026-08-21 3:41 ` [PATCH login-manager v3 5/5] fix #4281: ui: fix stale Continue button state on realm switch Azharul Haque
2026-08-26 10:24 ` Shan Shaji [this message]
2026-08-21 3:41 ` [PATCH flutter-frontend v3 1/3] chore: regenerate plugin registrant for flutter_web_auth_2 Azharul Haque
2026-08-21 3:41 ` [PATCH flutter-frontend v3 2/3] fix #4281: android: set taskAffinity="" on MainActivity Azharul Haque
2026-08-21 3:41 ` [PATCH flutter-frontend v3 3/3] fix #4281: android: register OpenID Connect callback activity Azharul Haque
2026-08-26 11:41 ` [PATCH v3 00/10] app: implement OpenID Connect (OAuth) realm login (#4281) Shan Shaji
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=DKYSWGTHSUK1.1CDZQ1USIJBCX@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=haque@azharul.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 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.