fix(ui): prevent TaskEditDialog from unmounting when opened (#395)
The edit button was calling onOpenChange(false) which triggered setSelectedTask(null) in App.tsx, causing the entire TaskDetailModal to unmount - including the TaskEditDialog that was just opened. Fix: Remove the onOpenChange(false) call. The edit dialog now opens on top of the parent modal using proper z-index stacking via Portal. Reported by: Mitsu Signed-off-by: Black Circle Sentinel <mludlow000@icloud.com> Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>
This commit is contained in:
@@ -307,11 +307,7 @@ function TaskDetailModalContent({ open, task, onOpenChange, onSwitchToTerminals,
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="hover:bg-primary/10 hover:text-primary transition-colors"
|
||||
onClick={() => {
|
||||
state.setIsEditDialogOpen(true);
|
||||
// Hide parent modal while edit dialog is open to fix z-index stacking
|
||||
onOpenChange(false);
|
||||
}}
|
||||
onClick={() => state.setIsEditDialogOpen(true)}
|
||||
disabled={state.isRunning && !state.isStuck}
|
||||
>
|
||||
<Pencil className="h-4 w-4" />
|
||||
@@ -473,13 +469,7 @@ function TaskDetailModalContent({ open, task, onOpenChange, onSwitchToTerminals,
|
||||
<TaskEditDialog
|
||||
task={task}
|
||||
open={state.isEditDialogOpen}
|
||||
onOpenChange={(open) => {
|
||||
state.setIsEditDialogOpen(open);
|
||||
// Reopen parent modal when edit dialog closes
|
||||
if (!open) {
|
||||
onOpenChange(true);
|
||||
}
|
||||
}}
|
||||
onOpenChange={state.setIsEditDialogOpen}
|
||||
/>
|
||||
|
||||
{/* Delete Confirmation Dialog */}
|
||||
|
||||
Reference in New Issue
Block a user