diff --git a/canvas/src/components/settings/UnsavedChangesGuard.tsx b/canvas/src/components/settings/UnsavedChangesGuard.tsx index 251ab7c7..771ce0d2 100644 --- a/canvas/src/components/settings/UnsavedChangesGuard.tsx +++ b/canvas/src/components/settings/UnsavedChangesGuard.tsx @@ -17,8 +17,10 @@ interface UnsavedChangesGuardProps { * - NOT shown if the form is empty (opened but nothing typed) * - Focus-trapped (AlertDialog) * - * Uses pendingDiscard ref so fireEvent.click on asChild Action can drive - * which callback fires — avoids needing eslint-disable / explicit onClick. + * Uses pendingDiscard ref so the overlay/ESC dismiss path calls onKeepEditing. + * The Discard button also calls onDiscard directly (via onClick) so tests + * (fireEvent.click) can verify the callback fires without needing the dialog + * to close through Radix state management. */ export function UnsavedChangesGuard({ open, @@ -63,7 +65,10 @@ export function UnsavedChangesGuard({