From 5760bea00ba685a7019baf3202b0bc323865a178 Mon Sep 17 00:00:00 2001 From: felix-itz <69673133+felix-itz@users.noreply.github.com> Date: Wed, 26 Aug 2020 20:03:19 +0200 Subject: [PATCH] LDAP Sign-In form: user field attributes (#2014) - autocomplete="username": Tell the browser a user name should be filled, if any. Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete - autocapitalize="none": Tell browsers (especially on mobile devices like iOS) not to capitalize the first letter Reference: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#//apple_ref/doc/uid/TP40008058-autocapitalize - spellcheck="false": Do not spell-check the user name Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck - autofocus: indicates that the input should automatically have focus, which makes sense because this form is shown after having clicked the "login" button so it's not an issue that the screen reader will skip the "Sign in to your account" text. Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus This PR will improve usability especially on mobile devices. It does *not* not attempt to improve WCAG compliance. Co-authored-by: Ahmad Farhat --- app/views/sessions/ldap_signin.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/sessions/ldap_signin.html.erb b/app/views/sessions/ldap_signin.html.erb index 3d7c301c..799aa306 100644 --- a/app/views/sessions/ldap_signin.html.erb +++ b/app/views/sessions/ldap_signin.html.erb @@ -12,7 +12,7 @@ - <%= f.text_field :username, class: "form-control", placeholder: t("administrator.users.table.username"), value: "" %> + <%= f.text_field :username, class: "form-control", placeholder: t("administrator.users.table.username"), value: "", autocomplete: "username", autocapitalize: "none", spellcheck: "false", autofocus: "" %>
@@ -31,4 +31,4 @@
- \ No newline at end of file +