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) {
6666 },
6767
6868 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
7370 },
7471
7572 refreshMenuItems () {
Original file line number Diff line number Diff line change @@ -917,7 +917,7 @@ public function handleMoveItemDown(array $data): void
917917 }
918918 }
919919
920- public function moveItemUp (int $ itemId ): void
920+ public function moveItemUp (int $ itemId )
921921 {
922922 try {
923923 $ item = $ this ->getMenuItemSecurely ($ itemId );
@@ -935,12 +935,13 @@ public function moveItemUp(int $itemId): void
935935 if ($ previousSibling ) {
936936 $ item ->beforeNode ($ previousSibling )->save ();
937937
938- // Let Livewire handle refresh naturally - no manual refresh
939-
940938 Notification::make ()
941939 ->title ('Menu item moved up successfully. ' )
942940 ->success ()
943941 ->send ();
942+
943+ // Force page reload to avoid component issues
944+ return redirect ()->to (request ()->url ());
944945 }
945946 } catch (Exception $ e ) {
946947 Notification::make ()
@@ -950,7 +951,7 @@ public function moveItemUp(int $itemId): void
950951 }
951952 }
952953
953- public function moveItemDown (int $ itemId ): void
954+ public function moveItemDown (int $ itemId )
954955 {
955956 try {
956957 $ item = $ this ->getMenuItemSecurely ($ itemId );
@@ -968,12 +969,13 @@ public function moveItemDown(int $itemId): void
968969 if ($ nextSibling ) {
969970 $ item ->afterNode ($ nextSibling )->save ();
970971
971- // Let Livewire handle refresh naturally - no manual refresh
972-
973972 Notification::make ()
974973 ->title ('Menu item moved down successfully. ' )
975974 ->success ()
976975 ->send ();
976+
977+ // Force page reload to avoid component issues
978+ return redirect ()->to (request ()->url ());
977979 }
978980 } catch (Exception $ e ) {
979981 Notification::make ()
You can’t perform that action at this time.
0 commit comments