fix: response is unable to be copied (#5995)

* fix: response is unable to be copied

* fix: enable selection of text on readonly

* fix: no cursor when readonly
This commit is contained in:
sanish chirayath
2025-11-05 20:17:09 +05:30
committed by GitHub
parent 60b437ef9d
commit fa28ab9b50
5 changed files with 10 additions and 15 deletions

View File

@@ -9,14 +9,15 @@ const StyledWrapper = styled.div`
&.read-only {
.CodeMirror .CodeMirror-lines {
cursor: not-allowed !important;
user-select: none !important;
-webkit-user-select: none !important;
-ms-user-select: none !important;
}
.CodeMirror-line {
color: ${(props) => props.theme.colors.text.muted} !important;
}
.CodeMirror-cursor {
display: none !important;
}
}
.CodeMirror {

View File

@@ -36,7 +36,7 @@ class MultiLineEditor extends Component {
brunoVarInfo: {
variables
},
readOnly: this.props.readOnly ? 'nocursor' : false,
readOnly: this.props.readOnly,
tabindex: 0,
extraKeys: {
'Ctrl-Enter': () => {
@@ -132,7 +132,7 @@ class MultiLineEditor extends Component {
this.editor.setOption('theme', this.props.theme === 'dark' ? 'monokai' : 'default');
}
if (this.props.readOnly !== prevProps.readOnly && this.editor) {
this.editor.setOption('readOnly', this.props.readOnly ? 'nocursor' : false);
this.editor.setOption('readOnly', this.props.readOnly);
}
if (this.props.value !== prevProps.value && this.props.value !== this.cachedValue && this.editor) {
this.cachedValue = String(this.props.value);