Currently, we automatically instantiate a flatPickr instance for any input fields that have the flatpickr class. This instantiation is handling within a loop and works well in most cases. However, if the the input is paired so we have a start/end date pair and the start date is pre-populated with the template you are faced with javascript errors. This is because the pre-populated value triggers our onClose function that resides in the instantiation settings. The onClose looks for the associated 'end' input and grabs the flatpickr instance to set the minDate property.. but as we've not yet hit the end input field the flatpicker instance for that field doesn't yet exist.
Created attachment 127507 [details] [review] Bug 29450: Allow flatpickr to instantiate in any order This patch updates the flatpickr wrapper code to allow for cases where the startdate/enddate pickers are pre-populated and thus the onClose event of the startdate pickr may be fired before the enddate flatpickr is instantiated.. which leads to an error.
Created attachment 127621 [details] [review] Bug 29450: Allow flatpickr to instantiate in any order This patch updates the flatpickr wrapper code to allow for cases where the startdate/enddate pickers are pre-populated and thus the onClose event of the startdate pickr may be fired before the enddate flatpickr is instantiated.. which leads to an error.
Removed a console.log statement I errantly left in.. otherwise, latest patch matches the previous upload.
Can you remember where you observed this bug?
Hi Martin, could you please add a test plan for this?
(In reply to Katrin Fischer from comment #5) > Hi Martin, could you please add a test plan for this? Ping!