-
-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
helpHelp me!Help me!
Description
maryUI version
2.4.0
daisyUI version
5.0.35
Livewire version
3.6.3
What browsers are affected?
Firefox, Chrome, Safari, Microsoft Edge
What happened?
If a page has one or several DatePicker components on every page update a new instance(s) of the flatpickr is rendered.
The reason why it happens is the random key assigned to the component View/Components/DatePicker.php (108)
public function render(): View|Closure|string
{
return <<<'BLADE'
<div wire:key="datepicker-{{ rand() }}">
@php
// We need this extra step to support models arrays. Ex: wire:model="emails.0" , wire:model="emails.1"
$uuid = $uuid . $modelName()
@endphpThe following code fixes the issue:
public function render(): View|Closure|string
{
return <<<'BLADE'
@php
// We need this extra step to support models arrays. Ex: wire:model="emails.0" , wire:model="emails.1"
$uuid = $uuid . $modelName()
@endphp
<div wire:key="datepicker-{{ $uuid }}">Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
helpHelp me!Help me!