Skip to content

Commit

Permalink
fix: prevent Esc key from closing terminal modals
Browse files Browse the repository at this point in the history
Co-Authored-By: Nicholas Penree <nick@penree.com>
  • Loading branch information
devin-ai-integration[bot] and drudge committed Dec 23, 2024
1 parent f7c8324 commit ee469d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export const DockerTerminalModal = ({
{children}
</DropdownMenuItem>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-7xl">
<DialogContent
className="max-h-screen overflow-y-auto sm:max-w-7xl"
onEscapeKeyDown={(event) => event.preventDefault()}
>
<DialogHeader>
<DialogTitle>Docker Terminal</DialogTitle>
<DialogDescription>
Expand All @@ -73,7 +76,7 @@ export const DockerTerminalModal = ({
serverId={serverId || ""}
/>
<Dialog open={confirmDialogOpen} onOpenChange={setConfirmDialogOpen}>
<DialogContent>
<DialogContent onEscapeKeyDown={(event) => event.preventDefault()}>
<DialogHeader>
<DialogTitle>
Are you sure you want to close the terminal?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export const DockerTerminalModal = ({ children, appName, serverId }: Props) => {
return (
<Dialog open={mainDialogOpen} onOpenChange={handleMainDialogOpenChange}>
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent className="max-h-[85vh] overflow-y-auto sm:max-w-7xl">
<DialogContent
className="max-h-[85vh] overflow-y-auto sm:max-w-7xl"
onEscapeKeyDown={(event) => event.preventDefault()}
>
<DialogHeader>
<DialogTitle>Docker Terminal</DialogTitle>
<DialogDescription>
Expand Down Expand Up @@ -119,7 +122,7 @@ export const DockerTerminalModal = ({ children, appName, serverId }: Props) => {
containerId={containerId || "select-a-container"}
/>
<Dialog open={confirmDialogOpen} onOpenChange={setConfirmDialogOpen}>
<DialogContent>
<DialogContent onEscapeKeyDown={(event) => event.preventDefault()}>
<DialogHeader>
<DialogTitle>
Are you sure you want to close the terminal?
Expand Down

0 comments on commit ee469d5

Please sign in to comment.