New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting editor to "nocursor" readonly mode should still allow c&p #1099
Comments
This is intentional. Nocursor implies no selection. Just use |
I came here from Google wondering about the same thing. In case anyone is wondering how to apply this only to some text editors and not all, this worked for me: var cm = CodeMirror.fromTextArea(htmlElement, { /* options */ });
// Some condition to apply this to only text editors that are meant to be readonly
if (readonly) {
var $wrapper = $(cm.getWrapperElement());
$wrapper.addClass('CodeMirror-readonly'); // hides cursor
} Paired with the following css: /* Hide cursor in readonly fields */
.CodeMirror-readonly .CodeMirror-cursor {
display: none !important
} |
readOnly="nocursor" seem to have buggy c&p. see codemirror/codemirror5#2568 codemirror/codemirror5#1099
readOnly="nocursor" seem to have buggy c&p. see codemirror/codemirror5#2568 codemirror/codemirror5#1099 fixes spark-notebook#937
As the topic title says: Setting editor to "nocursor" readonly mode should still allow copy&paste operations.
The problem with readOnly : true is, that it implies "writability" for the normal user, as the cursor blinks, which is really confusing. But in "nocursor" mode, copying is suppressed, which is also irritating and not the xpected behavior (at least from me and 2 collegues).
It would be nice to fix that, if it's an unintentional oversight. Thanks!
edit: this is observed the behavior in FF 18 beta and newest Chrome
The text was updated successfully, but these errors were encountered: