Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timepicker - Bug on timepicker with fire event #2367

Open
cedbesafilm opened this issue Dec 28, 2020 · 2 comments
Open

Timepicker - Bug on timepicker with fire event #2367

cedbesafilm opened this issue Dec 28, 2020 · 2 comments

Comments

@cedbesafilm
Copy link

cedbesafilm commented Dec 28, 2020

https://jsfiddle.net/2eudkahz/

Your Environment

  • flatpickr version used: 4.6.9
  • Browser name and version: Google Chrome
  • OS and version: Windows 10

When i create a flatpickr istance with this configuration

const fp = flatpickr(".date", {
  dateFormat: "H:i",
  enableTime: true,
  noCalendar: true,
  time_24hr: true,
  disableMobile: true,
});

and later i access the instance with this command

var a = new Date("2021-12-10 05:00:12");
var testHour = document.getElementById("test");
testHour._flatpickr.setDate(a, true);

in the console i throw this error

flatpickr.js:1177 Uncaught TypeError: Cannot set property 'tabIndex' of undefined
    at buildMonthSwitch (flatpickr.js:1177)
    at jumpToDate (flatpickr.js:921)
    at Object.setDate (flatpickr.js:2299)

if i delete the true argument (but i need for fire the event) there are no errors
the error appears in this conditions

  • if I have not opened the input by manual click
  • if the date is in future
@cedbesafilm cedbesafilm changed the title Timepicker - Bug on set time based on future dates Timepicker - Bug on timepicker with fire event Dec 28, 2020
@scarry1992
Copy link

+1 same situation

@jonwayne-tithely
Copy link

using monthSelectorType: "static" config option resolved this for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants