alphagov / govuk_elements

❗️GOV.UK Elements is deprecated, and will only receive major bug fixes and security patches.
https://govuk-elements.herokuapp.com/
MIT License
227 stars 90 forks source link

Remove min, max attributes from date inputs #598

Closed 36degrees closed 6 years ago

36degrees commented 6 years ago

Remove the min and max attributes from all inputs in the various 'date' examples.

What problem does the pull request solve?

The current max attribute for the year is 2016, which means the examples are effectively two years ‘out of date’. Whilst services might be expected to populate the max attribute dynamically, we’ve seen in user research that developers often copy and paste code examples blindly, and this is more likely to introduce bugs in the future than it is to help anyone.

The min and max attributes only really ‘apply’ when using the spinner (which we consciously disable using CSS), or when using browser form validation, which we advise against. The current experience in the browser is also odd – It’s possible to enter 2020 in the above example in desktop chrome and safari on MacOS but If you then use keyboard up/down it ‘snaps’ to 2016.

There is more discussion about this issue in #597.

Closes #597.

How has this been tested?

This change has not been explicitly tested, because the change in behaviour is well defined.

What type of change is it?

Has the documentation been updated?