File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,7 @@ function menuItemsManager(config) {
66
66
},
67
67
68
68
setupEventListeners () {
69
- // Listen for Livewire events to refresh menu items
70
- this .$wire .on (' menu-items-updated' , () => {
71
- this .refreshMenuItems ();
72
- });
69
+ // No event listeners needed - using natural Livewire reactivity
73
70
},
74
71
75
72
refreshMenuItems () {
Original file line number Diff line number Diff line change @@ -917,7 +917,7 @@ public function handleMoveItemDown(array $data): void
917
917
}
918
918
}
919
919
920
- public function moveItemUp (int $ itemId ): void
920
+ public function moveItemUp (int $ itemId )
921
921
{
922
922
try {
923
923
$ item = $ this ->getMenuItemSecurely ($ itemId );
@@ -935,12 +935,13 @@ public function moveItemUp(int $itemId): void
935
935
if ($ previousSibling ) {
936
936
$ item ->beforeNode ($ previousSibling )->save ();
937
937
938
- // Let Livewire handle refresh naturally - no manual refresh
939
-
940
938
Notification::make ()
941
939
->title ('Menu item moved up successfully. ' )
942
940
->success ()
943
941
->send ();
942
+
943
+ // Force page reload to avoid component issues
944
+ return redirect ()->to (request ()->url ());
944
945
}
945
946
} catch (Exception $ e ) {
946
947
Notification::make ()
@@ -950,7 +951,7 @@ public function moveItemUp(int $itemId): void
950
951
}
951
952
}
952
953
953
- public function moveItemDown (int $ itemId ): void
954
+ public function moveItemDown (int $ itemId )
954
955
{
955
956
try {
956
957
$ item = $ this ->getMenuItemSecurely ($ itemId );
@@ -968,12 +969,13 @@ public function moveItemDown(int $itemId): void
968
969
if ($ nextSibling ) {
969
970
$ item ->afterNode ($ nextSibling )->save ();
970
971
971
- // Let Livewire handle refresh naturally - no manual refresh
972
-
973
972
Notification::make ()
974
973
->title ('Menu item moved down successfully. ' )
975
974
->success ()
976
975
->send ();
976
+
977
+ // Force page reload to avoid component issues
978
+ return redirect ()->to (request ()->url ());
977
979
}
978
980
} catch (Exception $ e ) {
979
981
Notification::make ()
You can’t perform that action at this time.
0 commit comments