diff --git a/src/frontend/src/modals/codeAreaModal/index.tsx b/src/frontend/src/modals/codeAreaModal/index.tsx index e68592efa..2766853f8 100644 --- a/src/frontend/src/modals/codeAreaModal/index.tsx +++ b/src/frontend/src/modals/codeAreaModal/index.tsx @@ -146,75 +146,83 @@ export default function CodeAreaModal({ setCode(value); }, [value, open]); + const handlePreventEsc = (e: React.KeyboardEvent) => { + if (e.key === "Escape") { + e.preventDefault(); + } + }; + return ( - - {children} - - {EDIT_CODE_TITLE} - - - -
-
- { - setCode(value); - }} - className="h-full w-full rounded-lg border-[1px] border-gray-300 custom-scroll dark:border-gray-600" - /> -
-
-
-

- {error?.detail?.error} -

-
- - {error?.detail?.traceback} - +
handlePreventEsc(e)}> + + {children} + + {EDIT_CODE_TITLE} + + + +
+
+ { + setCode(value); + }} + className="h-full w-full rounded-lg border-[1px] border-gray-300 custom-scroll dark:border-gray-600" + /> +
+
+
+

+ {error?.detail?.error} +

+
+ + {error?.detail?.traceback} + +
+
+ +
-
- -
-
- - + + +
); }