Input type date max attribute isn't honored when clicking on the up arrow to change the value
Reported by
jogj...@gmail.com,
Oct 12 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Have an input type="date" with a max attribute 2. Change the value using the up-down arrows in the control https://jsfiddle.net/1ghg2dyy/ if you don't want to run the attached test case What is the expected behavior? Should not be possible to increase the value past the value of the max attribute What went wrong? It is possible to increase the value past the max attribute Did this work before? N/A Does this work in other browsers? N/A Chrome version: 61.0.3163.100 Channel: stable OS Version: OS X 10.12.6 Flash Version: The min attribute works correctly with the up-down arrows
,
Dec 27 2017
What are other browsers' behaviors and what the spec say?
,
Dec 27 2017
FF 57.0.1 doesn't have an up-down arrow for input[type=date] It's datepicker grays out dates occurring before min and after max (as does Chrome's) Safari doesn't have a specific implementation for input[type=date]. Seems like it's treated as an input[type=text] Don't have access to a Windows VM or machine at the moment. I seem to remember at the time I filed this bug that Chrome's up-down arrows honored the min attribute (wouldn't reduce the month below min) but now they don't honor max or min. Here's a fiddle for min: https://jsfiddle.net/f1ppuzyf/1/ I don't think the spec mentions behavior for an up-down arrow for input[type=date] at all but I may be looking in the wrong place. https://html.spec.whatwg.org/multipage/input.html#date-state-(type=date) https://html.spec.whatwg.org/multipage/input.html#input-impl-notes Editorial: At the time I filed this bug it was because I believed the behavior of max and min wasn't consistent with each other (i.e. you could set dates higher than max but not less than min using clickable up-down arrows). I also see the reason why using keyboard up-down arrow keys might need to allow setting individual month, day or year fields outside of the ranges, for accessibility reasons e.g. I want to set 1 Dec 2012 when max is 1 Oct 2013, it would be annoying to set the year first then tab back to set the month. Allowing setting the month to 12 first then tabbing once to set the year is more convenient. So I understand the need for this behavior with keyboard operation. The up-down arrows in the control are clicked by mouse so (from an accessibility standpoint) I'm not convinced they need to have the same behavior as keyboard up-down arrow keys. I think their behavior should be consistent with the behavior of the dropdown datepicker.
,
Jan 9 2018
This is by design. We restrict only the first editable sub-field. We thought up-down arrow keys and spin-buttons should be consistent. I guess people have different opinions on this UX, and it's difficult to make everyone happy. |
|||
►
Sign in to add a comment |
|||
Comment 1 by divya.pa...@techmahindra.com
, Oct 13 2017Labels: Triaged-ET Needs-Triage-M61 M-63 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)