diff --git a/app/client/src/pages/Editor/Explorer/Actions/MoreActionsMenu.tsx b/app/client/src/pages/Editor/Explorer/Actions/MoreActionsMenu.tsx index 602a6a6d6e..2625fb0448 100644 --- a/app/client/src/pages/Editor/Explorer/Actions/MoreActionsMenu.tsx +++ b/app/client/src/pages/Editor/Explorer/Actions/MoreActionsMenu.tsx @@ -71,6 +71,10 @@ export function MoreActionsMenu(props: EntityContextMenuProps) { const deleteActionFromPage = useCallback( (actionId: string, actionName: string) => { dispatch(deleteAction({ id: actionId, name: actionName })); + // Reset the delete confirmation state because it can navigate to another action + // which will not remount this component + setConfirmDelete(false); + toggleMenuOpen(false); }, [dispatch], ); diff --git a/app/client/src/pages/Editor/JSEditor/AppJSEditorContextMenu.tsx b/app/client/src/pages/Editor/JSEditor/AppJSEditorContextMenu.tsx index 68d8c50f20..e9a34b00fe 100644 --- a/app/client/src/pages/Editor/JSEditor/AppJSEditorContextMenu.tsx +++ b/app/client/src/pages/Editor/JSEditor/AppJSEditorContextMenu.tsx @@ -85,8 +85,10 @@ export function AppJSEditorContextMenu({ [dispatch], ); const deleteJSCollectionFromPage = useCallback( - (actionId: string, actionName: string) => - dispatch(deleteJSCollection({ id: actionId, name: actionName })), + (actionId: string, actionName: string) => { + dispatch(deleteJSCollection({ id: actionId, name: actionName })); + setConfirmDelete(false); + }, [dispatch], );