make consistent with 4.x

This commit is contained in:
Dan Harrin
2025-07-03 09:00:34 +01:00
parent cf9b07bd8c
commit 1614e55b27
2 changed files with 9 additions and 18 deletions
@@ -17,6 +17,7 @@
$suffixIcon = $getSuffixIcon();
$suffixLabel = $getSuffixLabel();
$statePath = $getStatePath();
$disabledDates = $getDisabledDates();
@endphp
<x-dynamic-component
@@ -81,6 +82,13 @@
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')") }},
})"
wire:ignore
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
substr(md5(serialize([
'disabledDates' => $disabledDates,
'maxDate' => $maxDate,
'minDate' => $minDate,
])), 0, 64)
}}"
x-on:keydown.esc="isOpen() && $event.stopPropagation()"
{{
$attributes
@@ -96,7 +104,7 @@
<input
x-ref="disabledDates"
type="hidden"
value="{{ json_encode($getDisabledDates()) }}"
value="{{ json_encode($disabledDates) }}"
/>
<button
@@ -522,21 +522,4 @@ class DateTimePicker extends Field implements Contracts\HasAffixActions
return 'datetime-local';
}
public function getKey(bool $isAbsolute = true): ?string
{
if ($this->isNative() || $this->key !== null) {
return parent::getKey($isAbsolute);
}
$values = [
'minDate' => $this->getMinDate(),
'maxDate' => $this->getMaxDate(),
'disabledDates' => $this->getDisabledDates(),
];
$this->key = substr(md5(serialize($values)), 0, 8);
return parent::getKey($isAbsolute);
}
}