You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
When a CodeMirror editor is configured as read-only and the user opens a context menu, they can still see the cut and paste options.
It can be misleading since clicking on these items will do nothing.
While inspecting the elements inside the CM editor, I noticed a hidden <textarea> nested under a classless <div> styled with overflow: hidden among other things, right under <div class="CodeMirror cm-s-default">.
If I add the readonly attribute to that <textarea>, the issue seems fixed but could this lead to unwanted side effects?
JSFiddle for repro (reproducible in Chrome, Firefox and Edge)
When a CodeMirror editor is configured as read-only and the user opens a context menu, they can still see the cut and paste options.
It can be misleading since clicking on these items will do nothing.
While inspecting the elements inside the CM editor, I noticed a hidden
<textarea>nested under a classless<div>styled withoverflow: hiddenamong other things, right under<div class="CodeMirror cm-s-default">.If I add the
readonlyattribute to that<textarea>, the issue seems fixed but could this lead to unwanted side effects?