-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Hi @monim67
Thanks for this module!
I faced with issue that it does not works in the Bootstrap modal as initialization JS waiting for DOMContentLoaded
event, but modal does not fires this event.
django-flatpickr.js:53
document.addEventListener('DOMContentLoaded', function (event) {
findAndProcessFlatpickrInputs(document);
document.addEventListener('DOMNodeInserted', function (event) {
setTimeout(() => {
if (event.target.querySelectorAll) findAndProcessFlatpickrInputs(event.target);
});
});
});
Modifying django-flatpickr.js:53 this way - everything becamoe work correctly, I created another copy of this file to use in modals, would be cool to find solution for both cases (DOMContentLoaded and shown.bs.modal) but I have no ideas right now.
document.addEventListener('shown.bs.modal', function (event) {
findAndProcessFlatpickrInputs(document);
document.addEventListener('DOMNodeInserted', function (event) {
setTimeout(() => {
if (event.target.querySelectorAll) findAndProcessFlatpickrInputs(event.target);
});
});
});
Metadata
Metadata
Assignees
Labels
No labels