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']) {