laravel-form-components
laravel-form-components copied to clipboard
DatePicker error and rendering issues
Laravel Form Components Version
v8.1
Laravel Version
9.52.12
Alpine Version
3.12.3
Bug description
datePicker component loses reference to the input after initialisation.
Uncaught TypeError: Cannot convert undefined or null to object
at slice (<anonymous>)
at _flatpickr (index.js:1979:10)
at flatpickr (index.js:2018:16)
at date-picker.js:28:43
_flatpickr @ index.js:1979
flatpickr @ index.js:2018
(anonymous) @ date-picker.js:28
this.$refs.__input is populated when first rendering the page but when changing anything else on the page that causes a render, it becomes undefined and throws an error.
queueMicrotask(() => {
this.__ready = true;
this.__flatpickr = window.flatpickr(this.$refs.__input, this.__config());
});
It is also randomly showing the clear button when not active?
Steps to reproduce
Using the following:
<x-date-picker name="date" wire:model="date" :allow-input="false" format="d/m/Y" placeholder="dd/mm/yyyy" />
Relevant log output
No response
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.