diff --git a/packages/insomnia/src/ui/components/codemirror/code-editor.tsx b/packages/insomnia/src/ui/components/codemirror/code-editor.tsx index 2760b52b7..6743cd81c 100644 --- a/packages/insomnia/src/ui/components/codemirror/code-editor.tsx +++ b/packages/insomnia/src/ui/components/codemirror/code-editor.tsx @@ -103,6 +103,7 @@ export interface CodeEditorProps { // NOTE: for caching scroll and marks uniquenessKey?: string; updateFilter?: (filter: string) => void; + disableContextMenu?: boolean; } const normalizeMimeType = (mode?: string) => { @@ -171,6 +172,7 @@ export const CodeEditor = memo(forwardRef(({ style, uniquenessKey, updateFilter, + disableContextMenu, }, ref) => { const inputRef = useRef(null); const textAreaRef = useRef(null); @@ -570,7 +572,7 @@ export const CodeEditor = memo(forwardRef(({ data-editor-type="text" data-testid="CodeEditor" onContextMenu={event => { - if (readOnly) { + if (readOnly || disableContextMenu) { return; } event.preventDefault(); diff --git a/packages/insomnia/src/ui/components/editors/pre-request-script-editor.tsx b/packages/insomnia/src/ui/components/editors/pre-request-script-editor.tsx index 675c99702..c8631b86c 100644 --- a/packages/insomnia/src/ui/components/editors/pre-request-script-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/pre-request-script-editor.tsx @@ -201,11 +201,11 @@ export const PreRequestScriptEditor: FC = ({