Navigation Menu

Skip to content

Commit

Permalink
fix codemirror 'nocursor' bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Mar 21, 2020
1 parent 1acbdf0 commit e8df2da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/Carbon.js
Expand Up @@ -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 =
Expand Down Expand Up @@ -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']) {
Expand Down

0 comments on commit e8df2da

Please sign in to comment.