diff --git a/resources/views/kanban-scripts.blade.php b/resources/views/kanban-scripts.blade.php index 0d2c946..85a1786 100644 --- a/resources/views/kanban-scripts.blade.php +++ b/resources/views/kanban-scripts.blade.php @@ -13,7 +13,7 @@ function setData(dataTransfer, el) { function onAdd(e) { const recordId = e.item.id - const status = e.to.id + const status = e.to.dataset.statusId const fromOrderedIds = [].slice.call(e.from.children).map(child => child.id) const toOrderedIds = [].slice.call(e.to.children).map(child => child.id) @@ -22,7 +22,7 @@ function onAdd(e) { function onUpdate(e) { const recordId = e.item.id - const status = e.from.id + const status = e.from.dataset.statusId const orderedIds = [].slice.call(e.from.children).map(child => child.id) Livewire.dispatch('sort-changed', {recordId, status, orderedIds}) @@ -31,7 +31,7 @@ function onUpdate(e) { document.addEventListener('livewire:navigated', () => { const statuses = @js($statuses->map(fn ($status) => $status['id'])) - statuses.forEach(status => Sortable.create(document.getElementById(status), { + statuses.forEach(status => Sortable.create(document.querySelector(`[data-status-id='${status}']`), { group: 'filament-kanban', ghostClass: 'opacity-50', animation: 150, diff --git a/resources/views/kanban-status.blade.php b/resources/views/kanban-status.blade.php index 94a49b2..2078e9c 100644 --- a/resources/views/kanban-status.blade.php +++ b/resources/views/kanban-status.blade.php @@ -4,7 +4,7 @@ @include(static::$headerView)
@foreach($status['records'] as $record)