From b630355d03faef808a1063bd45f196a949e01819 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 8 Dec 2022 15:17:58 +0100 Subject: [PATCH] Autofocus the login form on /sso/login --- core/admin/mailu/sso/forms.py | 2 +- towncrier/newsfragments/2577.misc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 towncrier/newsfragments/2577.misc diff --git a/core/admin/mailu/sso/forms.py b/core/admin/mailu/sso/forms.py index ca124c02..c01ef572 100644 --- a/core/admin/mailu/sso/forms.py +++ b/core/admin/mailu/sso/forms.py @@ -5,7 +5,7 @@ import flask_wtf class LoginForm(flask_wtf.FlaskForm): class Meta: csrf = False - email = fields.StringField(_('E-mail'), [validators.Email(), validators.DataRequired()]) + email = fields.StringField(_('E-mail'), [validators.Email(), validators.DataRequired()], render_kw={'autofocus': True}) pw = fields.PasswordField(_('Password'), [validators.DataRequired()]) pwned = fields.HiddenField(label='', default=-1) submitWebmail = fields.SubmitField(_('Sign in')) diff --git a/towncrier/newsfragments/2577.misc b/towncrier/newsfragments/2577.misc new file mode 100644 index 00000000..a9c467cf --- /dev/null +++ b/towncrier/newsfragments/2577.misc @@ -0,0 +1 @@ +Autofocus the login form on /sso/login