Issue with flatpickr Script in Elementor Popups #24979
uber-mastermas
started this conversation in
Feature Request
Replies: 1 comment
|
The script initializes flatpickr on an element after the DOM loads, setting up a date format and a range between a minimum and a maximum date. It also includes a function to disable specific dates, like April 15, 2024. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
What problem is your feature request going to solve? Please describe..
I'm encountering an issue where a flatpickr script functions on standard pages but not within Elementor popups. I'm seeking a solution to make flatpickr work consistently in Elementor popups
Describe the solution you'd like.
I would like a solution that ensures the flatpickr script is consistently executed and functional within Elementor popups, just as it operates on standard pages.
Describe alternatives you've considered.
As an alternative, I've considered using different JavaScript timing methods, like waiting for the full load of all dynamic content, or attaching the script directly within Elementor's popup structure. Switching to a different form builder like Formidable Forms is another alternative ;))
Additional context
Below is the script that functions correctly on standard web pages but not in Elementor popups. I'm looking for guidance to make this work similarly within Elementor's popup environment:
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
flatpickr("#form-field-date_to", {
altFormat: "d/m/Y",
dateFormat: "d/m/Y",
minDate: new Date().fp_incr(3),
maxDate: new Date("2024-12-31"),
"disable": [
function(date) {
return date.getDate() === 15 && date.getMonth() === 3 && date.getFullYear() === 2024;
}
],
locale: {
firstDayOfWeek: 1
}
});
}, 1000);
});
Agreement
All reactions