Problem/Motivation

This is essentially a backport from D8 core issue. The user login form lacks attributes "autocapitalize", "spellcheck" and "autocorrect" creating problems on some mobile browsers (like Safari). Previous issue seems that there is a tension between W3C compliance and usability ().

Proposed resolution

Proposed solution to add to user form:

  • autocorrect="none"
  • autocapitalize="none"
  • spellcheck="false"

Remaining tasks

- discuss
- patch
- review

User interface changes

None

API changes

None

Comments

robertwb’s picture

Issue summary: View changes
robertwb’s picture

StatusFileSize
new560 bytes

Attached patch implementing proposed solution.

robertwb’s picture

StatusFileSize
new525 bytes

Updated - removed autofocus

cilefen’s picture

Status: Active » Needs review
cilefen’s picture

+++ b/modules/user/user.module
@@ -1340,6 +1340,11 @@ function user_login_block($form) {
+      'autocapitalize' => 'none', ¶

You have a space at the end of this line.

robertwb’s picture

StatusFileSize
new524 bytes

Removed extraneous space from line. Thanks @cilefen

cilefen’s picture

Is this needed on the registration form too?

cilefen’s picture

Status: Needs review » Needs work

It is surely needed on the /user form also, and we have to decide about the registration form.

robertwb’s picture

StatusFileSize
new902 bytes

OK - attached patch has it on the /user form. The reg form is above my pay grade :) I would opt to do what they did in the d8? Which I think was not to touch it, but the form structure is much different there so that may be a bad assumption on my part.

robertwb’s picture

Status: Needs work » Needs review
robertwb’s picture

StatusFileSize
new652 bytes
robertwb’s picture

Status: Needs review » Needs work

The last submitted patch, 11: 2537814-1.patch, failed testing.

robertwb queued 9: 2537190-9.patch for re-testing.

robertwb’s picture

Status: Needs work » Needs review
robertwb’s picture

Status: Needs review » Active
robertwb’s picture

Status: Active » Needs review
robertwb’s picture

StatusFileSize
new938 bytes
new938 bytes

This brings into line with the D8 login.

poker10’s picture

Is there a reason why in the D8 patch was 'spellcheck' => 'false', and here is 'spellcheck' => 'none',? The 'spellcheck' => 'false', is still present in D9 codebase, so I suppose this is the correct one.

jenlampton’s picture

Status: Needs review » Needs work

Setting to NW based on the latest comment by @poker10 .

damienmckenna’s picture

Would it be worth backporting #3181647: Add autocomplete attributes on login form and password reset form too, or maybe instead?

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.