Skip to content

Commit 5aa4072

Browse files
authored
Update leaflet-input.blade.php
1 parent 214ce4f commit 5aa4072

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

resources/views/forms/components/leaflet-input.blade.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
:required="$isRequired()"
99
:state-path="$getStatePath()"
1010
>
11+
@php
12+
$uniqid = uniqid();
13+
@endphp
1114
<div x-data="data()">
1215
<span x-text="label()" class="font-bold text-sm"></span>
13-
<div id="{{ str_replace('.', '-', $getStatePath()) }}-map" style="height: {{$getMapHeight()}}px; z-index: 0;" class="w-full rounded-lg shadow-sm" wire:ignore></div>
16+
<div id="{{ str_replace('.', '-', $getStatePath()) . '-' . $uniqid }}-map" style="height: {{$getMapHeight()}}px; z-index: 0;" class="w-full rounded-lg shadow-sm" wire:ignore></div>
1417

1518
@push('scripts')
1619
@if($isViewRecord())
@@ -34,7 +37,7 @@ function data() {
3437
searchLabel = this.state.label;
3538
}
3639
37-
const map = L.map('{{ str_replace('.', '-', $getStatePath()) }}-map', {
40+
const map = L.map('{{ str_replace('.', '-', $getStatePath()) . '-' . $uniqid }}-map', {
3841
zoomControl: {{ $getZoomControl() }},
3942
scrollWheelZoom: {{ $getScrollWheelZoom() }}
4043
}).setView([0, 0], 0);

0 commit comments

Comments
 (0)