question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing month closes date picker on Chrome Version 62.0.3202.89

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
kburton-devcommented, Dec 1, 2017

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, only new-password on all of the password input fields in the DOM would fix this.

Still baffled by this.

0reactions
Mwnicommented, Dec 3, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show a browser picker for date, time, color, and files
A browser picker is shown when the <input> element is one of these types: "date" , "month" , "week" , "time" , "datetime-local"...
Read more >
Date Picker Dialog Example | APG | WAI
Choosing a date from the calendar closes the dialog and populates the date input ... Enter, Change the month and/or year displayed in...
Read more >
Google Chrome datepicker events
Chrome 24 fires the change event when the date has changed, even if the focus has not been moved from the textbox. The...
Read more >
Date Picker - Components - Paste: The Design System for ...
Version 3.0.1 ... Chrome/Edge, Safari and Firefox all support the Date Picker, ... "Today" button selects current date and closes calendar pop-up.
Read more >
<input type="month"> - HTML: HyperText Markup Language
Clicking the down arrow on the right-hand side brings up a date picker that lets you select the month and year. Month control...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found