From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox_login_manager v2 1/4] fix: ui: disable continue button by default in login form
Date: Tue, 11 Nov 2025 15:00:02 +0100 [thread overview]
Message-ID: <20251111140005.41510-2-s.shaji@proxmox.com> (raw)
In-Reply-To: <20251111140005.41510-1-s.shaji@proxmox.com>
When adding a remote the continue button is initially submit-able,
even though the "origin" field is empty. Tapping the button will show
the error and greys out the button.
To improve UX the button will be disabled by default and gets enabled
only if the form validation succeeds unless the already saved origin
value is used. If the value is available then the continue button will
be enabled if the origin value is not empty. Also fixed a typo in the
boolean variable.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v1:
- enable the continue button if the origin value is not empty.
lib/proxmox_login_form.dart | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
index 030e546..e193c57 100644
--- a/lib/proxmox_login_form.dart
+++ b/lib/proxmox_login_form.dart
@@ -211,7 +211,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
PveAccessDomainModel? _selectedDomain;
final _formKey = GlobalKey<FormState>();
ProxmoxProgressModel _progressModel = ProxmoxProgressModel();
- bool _submittButtonEnabled = true;
+ bool _submitButtonEnabled = false;
bool _canSavePassword = false;
bool _savePasswordCB = false;
@@ -222,6 +222,8 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
_progressModel = ProxmoxProgressModel();
if (!widget.isCreate! && userModel != null) {
_originController.text = userModel.origin?.toString() ?? '';
+ _submitButtonEnabled = _originController.text.isNotEmpty;
+
// Uri does not append 443 for https, so we do it manually
if (userModel.origin != null &&
userModel.origin!.scheme == "https" &&
@@ -232,6 +234,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
_accessDomains = _getAccessDomains();
_usernameController.text = userModel.username!;
_savePasswordCB = widget.password != null;
+
if ((widget.ticket!.isNotEmpty && userModel.activeSession) ||
widget.password != null) {
_onLoginButtonPressed(ticket: widget.ticket!, mRealm: userModel.realm);
@@ -330,7 +333,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
key: _formKey,
onChanged: () {
setState(() {
- _submittButtonEnabled =
+ _submitButtonEnabled =
_formKey.currentState!.validate();
});
},
@@ -381,7 +384,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
final isValid =
_formKey.currentState!.validate();
setState(() {
- _submittButtonEnabled = isValid;
+ _submitButtonEnabled = isValid;
});
if (isValid) {
setState(() {
@@ -389,12 +392,12 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
});
}
},
- onPasswordSubmitted: _submittButtonEnabled
+ onPasswordSubmitted: _submitButtonEnabled
? () {
final isValid =
_formKey.currentState!.validate();
setState(() {
- _submittButtonEnabled = isValid;
+ _submitButtonEnabled = isValid;
});
if (isValid) {
_onLoginButtonPressed();
@@ -408,13 +411,13 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
child: SizedBox(
width: MediaQuery.of(context).size.width,
child: TextButton(
- onPressed: _submittButtonEnabled
+ onPressed: _submitButtonEnabled
? () {
final isValid = _formKey
.currentState!
.validate();
setState(() {
- _submittButtonEnabled =
+ _submitButtonEnabled =
isValid;
});
if (isValid) {
--
2.50.1
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-11-11 14:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 14:00 [pve-devel] [PATCH proxmox_login_manager v2 0/4] fix #6983: ui: make cosmetic changes inside the login screen Shan Shaji
2025-11-11 14:00 ` Shan Shaji [this message]
2025-11-11 14:00 ` [pve-devel] [PATCH proxmox_login_manager v2 2/4] fix: ui: add more padding around the form in portrait mode Shan Shaji
2025-11-11 14:00 ` [pve-devel] [PATCH proxmox_login_manager v2 3/4] fix: ui: remove app bar and stack the close button on body Shan Shaji
2025-11-11 14:00 ` [pve-devel] [PATCH proxmox_login_manager v2 4/4] cleanup: run dart format command to fix formatting Shan Shaji
2025-11-12 9:21 ` [pve-devel] applied: [PATCH proxmox_login_manager v2 0/4] fix #6983: ui: make cosmetic changes inside the login screen Dominik Csapak
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=20251111140005.41510-2-s.shaji@proxmox.com \
--to=s.shaji@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