coopdigital / coop-frontend

Co-op CSS Foundations and design system mono-repo
MIT License
0 stars 0 forks source link

feat: add autocapitalize to postcode inputs to encourage all caps entry on virtual keyboards #458

Closed philwolstenholme closed 2 years ago

philwolstenholme commented 2 years ago

This is a very small change to the example markup for a postcode entry component that uses the autocapitalize HTML attribute to instruct virtual keyboards (e.g. on mobile) to default to using 'ALL CAPS' entry rather than 'Sentence case' entry. We recently added this to https://shop.coop.co.uk.

Postcode input is specifically mentioned as a good use case in this Google Developers blog introducing the attribute:

Use autocapitalization=characters if you are expecting:

  • US states
  • UK postal codes

There is a typo in that blog post quotation above where the author has called the attribute autocapitalization instead of autocapitalize, but the attribute name is definitely autocapitalize.