From 221021a798546df4bea57a44a6048101fd574013 Mon Sep 17 00:00:00 2001 From: "Keith J. Grant" Date: Fri, 19 Feb 2021 15:30:27 -0800 Subject: [PATCH] disable interactive elements of CodeEditor in readOnly mode --- awx/ui_next/src/components/CodeEditor/CodeEditor.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx b/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx index b60934a665..465d02f909 100644 --- a/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx +++ b/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx @@ -44,6 +44,14 @@ const AceEditor = styled(ReactAce)` background: var(--pf-c-form-control--invalid--Background); border-bottom-width: var(--pf-c-form-control--invalid--BorderBottomWidth); }`} + + ${props => + props.setOptions.readOnly && + ` + && .ace_cursor { + opacity: 0; + } + `} `; AceEditor.displayName = 'AceEditor'; @@ -132,6 +140,8 @@ function CodeEditor({ hasErrors={hasErrors} setOptions={{ readOnly, + highlightActiveLine: !readOnly, + highlightGutterLine: !readOnly, useWorker: false, }} commands={[