Changing month closes date picker on Chrome Version 62.0.3202.89
See original GitHub issueI downloaded the latest version of Chrome, version 62.0.3202.89, and using this breaks our date picker.
When I attempt to change months by selecting the previous month or next month arrow, the date picker closes.
My colleague has just pointed out that this issue is not present on the website: http://amsul.ca/pickadate.js/date/ on the latest version of Chrome, so it may be an issue with our system and I will verify. Thanks folks.
Update 1: Seeing an issue here: https://github.com/amsul/pickadate.js/blob/master/lib/picker.js#L266.
This section of code is only triggered in the latest version of Chrome.
Update 2: target
is returning the incorrect value on line https://github.com/amsul/pickadate.js/blob/master/lib/picker.js#L268 in Chrome but I am not sure why? I think again that this could be an issue with our system.
Update 3: Using var target = event.currentTarget
instead of var target = event.target
seems to work on the same line mentioned above. However, the date picker will not close unless a date is selected.
Update 4: I have a input field on the same screen as the datepicker that is of type password with autocomplete off. I think this is the issue. If I remove this field or change it to disabled there is no issue with the date picker.
Update 5: We believe there is an issue with autocomplete in Chrome, we have a password input field on the same screen that uses autocomplete="off"
but we think we should be using autocomplete="new-password"
and that this was somehow interfering with the date picker in Chrome. I will confirm this.
Final update: So autocomplete will cause an issue with Chrome in the latest version, possibly since earlier this year, if you also have a password input field on the same view with autocomplete=“off”.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5
I am having the exact same problem on computers with Chrome 62. What completely threw me off was that it worked fine in incognito mode. I also converged on the cause being the password fields in the page but thanks to @adrianmann, I was able to workaround this by adding the
autocomplete="new-password"
attribute to my password fields.No other attribute value would work for me. Setting the autocomplete attribute to
off
,on
,current-password
, would not work, onlynew-password
on all of the password input fields in the DOM would fix this.Still baffled by this.
Same issue here. I found the culprit: When changing the month, the picker gets re-rendered. (basically pickerbox.html(html_string)). This is where the bug is. Chrome somehow thinks this re-rendering has something todo with any login forms on page and perfoms an autofill (where the inputs get marked yellow). This triggers an focusin event on the login inputs, and since the picker listens for focusin events in order to close itself if a different input has been focused, it closes.
The workaround for now, is to simply ignore any focusin events that are simulated. (The focusin event triggered by the autofill has the isSimulated flag set to true)
picker.js.fixed.zip