{
+ if (nextOpen) openConfirm(key);
+ else closeConfirm();
+ }}
+ onConfirm={(e) => {
+ e?.stopPropagation?.();
+ closeConfirm();
+
+ // Critical: for informational popconfirms, keep the dropdown open so the Popconfirm can cleanly close.
+ if (closeDropdownOnConfirm) {
+ setDropdownOpen(false);
+ }
+
+ onConfirm?.(e);
+ }}
+ onCancel={(e) => {
+ e?.stopPropagation?.();
+ closeConfirm();
+ // Keep dropdown open on cancel so the user can continue using the menu.
+ }}
+ getPopupContainer={() => document.body}
+ >
+ {
+ e.preventDefault();
+ e.stopPropagation();
+ openConfirm(key);
+ }}
+ >
+ {text}
+
+
+ );
// Function to show modal
const showCancelScheduleModal = () => {
@@ -549,12 +635,6 @@ export function JobsDetailHeaderActions({
});
};
- // Function to handle OK
- const handleCancelScheduleOK = async () => {
- await form.submit(); // Assuming 'form' is the Form instance from useForm()
- setIsCancelScheduleModalVisible(false);
- };
-
const handleLostSaleFinish = async ({ lost_sale_reason }) => {
const jobUpdate = await cancelAllAppointments({
variables: {
@@ -884,34 +964,26 @@ export function JobsDetailHeaderActions({
{
key: "duplicate",
id: "job-actions-duplicate",
- label: (
-