From e8df2da86f42a24a362373c5547c777329c84970 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sat, 21 Mar 2020 16:59:21 -0700 Subject: [PATCH] fix codemirror 'nocursor' bug --- components/Carbon.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Carbon.js b/components/Carbon.js index 8dc1d07..da9e823 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -152,7 +152,7 @@ class Carbon extends React.PureComponent { extraKeys: { 'Shift-Tab': 'indentLess' }, - readOnly: this.props.readOnly ? 'nocursor' : false, + readOnly: this.props.readOnly, showInvisibles: config.hiddenCharacters } const backgroundImage = @@ -296,6 +296,10 @@ class Carbon extends React.PureComponent { cursor: pointer; } + .container :global(.CodeMirror-cursor) { + visibility: ${this.props.readOnly ? 'hidden' : ''}; + } + @media (max-width: 768px) { /* show cursor on mobile */ .container :global([contenteditable='true']) {