Select->default(1) doesnt work in CalendarWidget
I have this issue where if I set a default value in default() the form doesnt show that default value, whereas if I try this in the Resource page, it works. Am I maybe missing something?
Solution:Jump to solution
I think I figured it out. Here:
```php
protected function getCreateEventForm(): array
{
return [...
9 Replies
Are you calling
$this->form->fill()
in your component? (e.g. mount()
method)@Matthew π
Hey sorry, for late reaction
No I dont.
The Widget is on the Dashboard. I assume by component, you mean that
Solution
I think I figured it out. Here:
But this form is empty for a second before its filled with default data
So when I click on an event, the form shows and its unfilled for a second, then it gets filled
Is this expected or am I filling the form too late?
If I'm reading this correctly, I think this delay is expected... it could be caused by some javascript (e.g. the calendar plugin) that runs before Livewire handles the
wire:model
directives on the form elements.Okk! Thank you