diff --git a/browse/js/preview-yaml.js b/browse/js/preview-yaml.js index c6b4883..fe017be 100644 --- a/browse/js/preview-yaml.js +++ b/browse/js/preview-yaml.js @@ -484,9 +484,14 @@ // .zddc files without diverting into the editor. User // clicks (or tabs) into the editor when they want to type. autofocus: false, - // CodeMirror's "nocursor" mode is the truest read-only: - // selection allowed for copy, no caret, no edit affordances. - readOnly: !writable ? 'nocursor' : false, + // Read-only uses readOnly:true (NOT "nocursor"): the editor + // stays focusable so the user can click in, select text, and + // copy — they just can't edit. "nocursor" removes the textarea + // from focus, which also kills click-drag selection (the whole + // reason a viewer would otherwise force admin mode just to copy + // a .zddc snippet). autofocus:false keeps arrow-key tree nav + // intact until the user deliberately clicks into the editor. + readOnly: !writable, }); // Stash the node on the editor so the lint helper can decide // whether to apply the .zddc schema layer.