From ada2c1fe59d5126e817738d0b56ff0278a532131 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 16 Dec 2021 18:00:36 +0700 Subject: [PATCH] add autofocus and autocomplete to user form field, #104 --- tubearchivist/home/forms.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/forms.py b/tubearchivist/home/forms.py index 758500fc..f85392dc 100644 --- a/tubearchivist/home/forms.py +++ b/tubearchivist/home/forms.py @@ -11,7 +11,14 @@ class CustomAuthForm(AuthenticationForm): """better styled login form""" username = forms.CharField( - widget=TextInput(attrs={"placeholder": "Username"}), label=False + widget=TextInput( + attrs={ + "placeholder": "Username", + "autofocus": True, + "autocomplete": True, + } + ), + label=False, ) password = forms.CharField( widget=PasswordInput(attrs={"placeholder": "Password"}), label=False