Skip to content

Commit ee0f1c8

Browse files
committed
Remove drag and drop reordering and work with btns.
1 parent dc975ef commit ee0f1c8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Livewire/MenuTreeItem.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ public function delete(): void
9090

9191
public function moveUp(): void
9292
{
93-
// Dispatch event to parent component to move item up
94-
$this->dispatch('move-item-up', ['itemId' => $this->item->id]);
93+
// Call parent method directly to avoid component refresh issues
94+
$this->dispatch('move-item-up', ['itemId' => $this->item->id])->to('filament-flexible-content-block-pages::menu-resource.pages.manage-menu-items');
9595
}
9696

9797
public function moveDown(): void
9898
{
99-
// Dispatch event to parent component to move item down
100-
$this->dispatch('move-item-down', ['itemId' => $this->item->id]);
99+
// Call parent method directly to avoid component refresh issues
100+
$this->dispatch('move-item-down', ['itemId' => $this->item->id])->to('filament-flexible-content-block-pages::menu-resource.pages.manage-menu-items');
101101
}
102102

103103
public function render()

src/Resources/MenuResource/Pages/ManageMenuItems.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ public function moveItemUp(int $itemId)
941941
->send();
942942

943943
// Force page reload to avoid component issues
944-
return redirect()->to(request()->url());
944+
return redirect()->to(static::getUrl(['record' => $this->record->id]));
945945
}
946946
} catch (Exception $e) {
947947
Notification::make()
@@ -975,7 +975,7 @@ public function moveItemDown(int $itemId)
975975
->send();
976976

977977
// Force page reload to avoid component issues
978-
return redirect()->to(request()->url());
978+
return redirect()->to(static::getUrl(['record' => $this->record->id]));
979979
}
980980
} catch (Exception $e) {
981981
Notification::make()

0 commit comments

Comments
 (0)