fix codemirror 'nocursor' bug

main
Mike Fix 5 years ago
parent 1acbdf0529
commit e8df2da86f
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

@ -152,7 +152,7 @@ class Carbon extends React.PureComponent {
extraKeys: { extraKeys: {
'Shift-Tab': 'indentLess' 'Shift-Tab': 'indentLess'
}, },
readOnly: this.props.readOnly ? 'nocursor' : false, readOnly: this.props.readOnly,
showInvisibles: config.hiddenCharacters showInvisibles: config.hiddenCharacters
} }
const backgroundImage = const backgroundImage =
@ -296,6 +296,10 @@ class Carbon extends React.PureComponent {
cursor: pointer; cursor: pointer;
} }
.container :global(.CodeMirror-cursor) {
visibility: ${this.props.readOnly ? 'hidden' : ''};
}
@media (max-width: 768px) { @media (max-width: 768px) {
/* show cursor on mobile */ /* show cursor on mobile */
.container :global([contenteditable='true']) { .container :global([contenteditable='true']) {

Loading…
Cancel
Save