I have a very simple Livewire component with a text field and a date picker:
<!-- test.blade.php -->
<div>
<input type="text" wire:model="test" placeholder="Test">
<input datepicker="" wire:model="start" datepicker-format="dd.mm.yyyy" type="text" placeholder="Datum ...">
</div>
/* Test.php */
class Test extends Component
{
public $test;
public $start;
public function mount()
{
$this->start = now()->format('d.m.Y');
}
public function render()
{
return view('livewire.test');
}
}
The date picker I use is the Flowbite Datepicker.
When I change the date and then change the test input field, the date picker resets to today date.
What do I need to to to keep the value of start?
What I have already tried? I tried the wire:ignore on the date picker, but this does not help.
{{$start}} in the component to see it is not changing. But if you make the field not a datepicker - it is OK. – Blum Aug 25 '22 at 12:03