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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robertwb’s picture

Issue summary: View changes
robertwb’s picture

FileSize
560 bytes

Attached patch implementing proposed solution.

robertwb’s picture

FileSize
525 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

FileSize
524 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

FileSize
902 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

FileSize
652 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

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 .