Datetime-local input fields clear too easily on invalid keypress
Reported by
jasonrum...@gmail.com,
Jun 30 2018
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 Steps to reproduce the problem: 1. Make an HTML page with a datetime-local input field 2. Start typing a date and time with the keyboard 3. When reaching the AM/PM field at the end, press a lower case p What is the expected behavior? PM is selected What went wrong? The whole date and time was cleared, and it was necessary to start over. Did this work before? N/A Chrome version: 67.0.3396.87 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Also, if in the hour field, I enter '18', it is automatically changed to '06', but the AM/PM field remains blank.
,
Jul 2
Thanks for filing the issue! @Reporter: Could you please provide sample test file/URL that reproduces the issue which help in further triaging the issue. Thanks!
,
Jul 2
Sorry, when I try to minimise the test case again, I see that the problem was caused by some Javascript libraries that this input type makes obsolete.
The minimal test case I found is:
<!DOCTYPE html>
<html>
<head>
<title>Datepicker test</title>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.0/js/tempusdominus-bootstrap-4.min.js"></script>
</head>
<body>
<form>
<label for="test">Date and Time</label>
<div class="input-group date" data-target-input="nearest" id="dt-test">
<input name="testdatetime" type="datetime-local" id="test" class="form-control datetimepicker-input" data-target="#dt-test">
</div>
</form>
</body>
</html>
,
Jul 2
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 5
Tested the issue on chrome reported version# 67.0.3396.87 using Windows-7 & 10 with steps mentioned below: 1) Launched chrome reported version 2) Created html file with the code provided in comment# 3, dropped the file in chrome window 3) Tried giving the Date and Time in the respective fields, able to provide Date and from Time able to give hours filed but while giving Minutes field all the values got erased, and didn't find field for providing Am/PM. @Reporter: Please find the attached screencast for your reference and let us know if we missed anything in reproducing the issue, provide your feedback on it which help in further triaging it. Thanks!
,
Jul 5
There may be some relation to the locale settings in the OS, as I see an additional AM/PM field. But it seems the real issue is that the additional jquery/moment/tempus-dominus javascript are clearing it when the final field is changed, and my initial observation was a bit off. Since the issue is caused by the extra javascript library, I think it is OK to close this issue if you do not want to investigate further.
,
Jul 5
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 5
I can reproduce exactly what is seen in the video if I go to "Change the date, time or number format" in Control Panel under "Clock, Language and Region", and change the "Short time" setting from "h:mm tt" to "H:mm".
,
Jul 12
jasonrumney@ Thanks for the update. Tested this issue on Windows 10 on the latest Stable 67.0.3396.99 and the latest canary 69.0.3487.0 as per comment #8. 1. Changed the Short time format to 'H:mm' in system settings. 2. Launched Chrome and opened the above html file. 3. Tried entering the Date and Time in the respective fields, able to provide details, but while giving Minutes field all the values got erased, and didn't find field for providing AM/PM. Attached is the screen cast for reference. Request you to check and confirm if anything is missed from our end in triaging the issue. Also request you to update Chrome to the latest Stable 67.0.3396.99, retry the issue and if possible provide a screen cast of the steps followed where the issue is reproduced which will help us in better understanding. Thanks..
,
Jul 12
,
Jul 12
Hey Google, Didn't you just reproduce the bug on the latest stable? Why do you need me to keep providing more info for a bug which I've already localised to a Javascript library?
,
Jul 12
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 13
Able to reproduce this issue on Windows 10, Mac OS 10.13.3 and Ubuntu 14.04 on the reported version 67.0.3396.87 and the latest Canary 69.0.3479 as per comment #11. This is a Non-Regression issue as the same behavior is observed from M-60 chrome builds, as attached in the screen cast in comment #10. Hence marking this as Untriaged for further updates from Dev. Thanks..
,
Nov 22
** UI Mass triage ** Able to reproduce the issue using latest chrome canary# 72.0.3617.0, hence adding respective labels. Thanks! |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by viswa.karala@chromium.org
, Jul 1