Faking an editable control in browser JavaScript

from blog marijnhaverbeke.nl/blog, | ↗ original
This is a post in the cm-internals series, describing the internals of the CodeMirror editor. The problem it tackles is this: you are writing a JavaScript control that needs to act as a text input field—it must be focusable, support copy and paste, receive typed input—but really isn't. I.e. you want to draw it yourself, and have full control over...