diff --git a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js index 8d2586c8b..ab007c662 100644 --- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js @@ -2,12 +2,6 @@ import styled from 'styled-components'; const StyledWrapper = styled.div` &.read-only { - div.CodeMirror .CodeMirror-lines { - user-select: none !important; - -webkit-user-select: none !important; - -ms-user-select: none !important; - } - div.CodeMirror .CodeMirror-cursor { display: none !important; } diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 721f35b42..742b93045 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -63,7 +63,7 @@ export default class CodeEditor extends React.Component { foldGutter: true, gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'], lint: this.lintOptions, - readOnly: this.props.readOnly ? 'nocursor' : false, + readOnly: !!this.props.readOnly, scrollbarStyle: 'overlay', theme: this.props.theme === 'dark' ? 'monokai' : 'default', extraKeys: { @@ -246,7 +246,7 @@ export default class CodeEditor extends React.Component { } if (this.props.readOnly !== prevProps.readOnly && this.editor) { - this.editor.setOption('readOnly', this.props.readOnly ? 'nocursor' : false); + this.editor.setOption('readOnly', !!this.props.readOnly); } this.ignoreChangeEvent = false;